php cheat sheet
// Converts a php object to an associative array
function object_to_array($data)
{
if(is_array($data) || is_object($data))
{
$result = array();
foreach($data as $key => $value)
{
$result[$key] = object_to_array($value);
}
return $result;
}
return $data;
}
// insert code here..
reference:
CodeSnippets: Convert an object to an associative array.
builds a nice dropdown select list.
<?php
/*
$all = DateTimeZone::listAbbreviations();
krumo($all);
*/
$timeZones = DateTimeZone::listIdentifiers();
echo '<select name="timeZone">';
foreach ( $timeZones as $timeZone ) {
printf('<option value="%s">%s</option>', date("O"), $timeZone);
}
echo '</select>';
?>