I am using pipeline.io to send prompts from a simple PHP form and then the script receives the JSON output. This part seems to be working fine and the image it returns based upon the prompt it is fed seems to be in the field [results_preview]. But attempting to decode it fails and I'm not sure what I'm doing wrong
Example code and JSON:
JASON: Array"[{\"id\":\"model_46f42d5cc07d4074bb308e304d0ffdbb\",\"name\":\"DALL\u00b7E Mini (Legacy)\",\"hex_file\":{\"name\":\"jXZHyFLLRCRjUaGWAyqH\",\"id\":\"file_7b60ade195fb4557a90596cdddcb7c4f\",\"path\":\"object_49gbh9hbkjvw3u64xohafzij6vqkzwqregbefm3x4d36lpmvjzhfqa3i0vn45ako\",\"data\":null,\"file_size\":23898},\"source_sample\":\"#pipeline_model\\nclass DallE_Mini_Model:\\n def __init__(self):\\n self.model = None\\n\\n #pipeline_function\\n def DallE_Mini_Predict(self, prompts: List[str], inference_kwargs: dict = {}) -> L\"}],\"graph_nodes\":[{\"local_id\":\"rulrTUYrMb\",\"function\":\"function_b8fb7cbf8b314d6aa48c3f66ee3b1533\",\"inputs\":[\"EEEBgZqnpW\",\"thaTHiQGzM\"],\"outputs\":[\"CIIIBPCpGH\"]}],\"outputs\":[\"CIIIBPCpGH\"]},\"data\":{\"id\":\"data_382db91cc43c40b39fcf84b0ede61c26\",\"hex_file\":{\"name\":\"_phj6z0dxywzowoyhieftic9qp71txui2cfrr6y3yod4vsz08uw\",\"id\":\"file_5f57dd7d84b943f5a40f45d2e6bbba42\",\"path\":\"data__znvh8junqbjhfn5rtskjv0sc18stt29vb8xwhoaee0s6iwzkh0ubqdvpem1ghmzv\",\"data\":null,\"file_size\":210},\"created_at\":1660001506.265047,\"modified_at\":null,\"name\":\"_phj6z0dxywzowoyhieftic9qp71txui2cfrr6y3yod4vsz08uw\",\"size\":null,\"file_type\":null,\"token_created_by\":null,\"token_modified_by\":null,\"url\":null,\"preview\":null},\"blocking\":true,\"result\":{\"name\":\"Run run_0e5a0231ea894831b708872eae89bab9 output\",\"id\":\"file_b7b1d226953a4bec98a09dd5c14fbdf7\",\"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3xVyIoy43qDjgbu9VTHvzlgB39TXKeK7660uJZtPYEREO6nqQTQB2M0rH5CgZx90jtWK2pywXID4Q7sEEcEU3SdXSW2SSVyXkQEq45U9eoqxqVnHdx5BUttyp\/8Ar0xE0t3NbBbhIVML9R1xT\/PtbpQy5Hp7VzGn6tNa3P2acllJCtGTxj1HpUkKfZpS0MwMTk7UPBHPagZ\/\/9k=\"]]],\"error\":null,\"project\":{\"avatar_colour\":\"#AA2216\",\"avatar_image_url\":null,\"name\":\"Default\",\"id\":\"project_83ffdc5c2cd54c5b95d8077a3cc15ec7\"}}"
<html>
<head></head>
<body></body>
<?php
$step=$_GET['step'];
$subject=$_GET['subject'];
$action=$_GET['action'];
$actionlist = array (
0 => 'going for a hike',
1 => 'wearing a backpack',
2 => 'practising archery',
3 => 'swimming in the ocean',
4 => 'tending to vegtables',
5 => 'watching for birds',
6 => 'doing parkour',
7 => 'using a metal detector',
8 => 'winning the stanley cup',
9 => 'looking through a telescope',
10 => 'riding a horse',
11 => 'driving a car',
12 => 'collecting stamps',
13 => 'visiting a mueseum',
14 => 'rock climbing',
15 => 'cleaning the kitchen',
16 => 'playing an xbox',
17 => 'baking a pie',
18 => 'making dinner',
19 => 'taking a photograph with a camera',
20 => 'knitting a sweater',
21 => 'practicing calligraphy',
22 => 'on the bridge of the U.S.S Enterprise',
23 => 'riding on a train',
24 => 'playing with lego ',
25 => 'stepping on lego',
26 => 'doing a jigsaw puzzle',
27 => 'playing tennis',
28 => 'playing table tennis',
29 => 'editing wikipedia',
30 => 'shopping a store',
31 => 'making coffee',
32 => 'scuba diving in the ocean',
33 => 'being angry online',
34 => 'waiting for their bookclub',
35 => 'to chill and study for exams with',
36 => 'winning the world series',
37 => 'out for a walk on a sunny day',
38 => 'enjoying a rainy day',
39 => 'playing chess',
40 => 'playing checkers',
41 => 'repairing their bathroom',
42 => 'repairing their kitchen',
43 => 'building a model car',
44 => 'reading a newspaper',
);
$subjectlist = [
0 => 'Muhammad Ali',
1 => 'Elvis Presley',
2 => 'Babe Ruth',
3 => 'John Lennon',
4 => 'Bob Dylan',
5 => 'Marilyn Monroe',
6 => 'Michael Jackson',
7 => 'Michael Jordan',
8 => 'Al Capone',
9 => 'Paul McCartney',
10 => 'Charlie Chaplin',
11 => 'Marlon Brando',
12 => 'Frank Sinatra',
13 => 'Alfred Hitchcock',
14 => 'Johnny Carson',
15 => 'Jackie Robinson',
16 => 'Walt Disney',
17 => 'David Bowie',
18 => 'Steve Jobs',
19 => 'Bruce Lee',
20 => 'Joe Namath',
21 => 'Bill Murray',
22 => 'Elton John',
23 => 'Denzel Washington',
24 => 'Elizabeth Taylor',
25 => 'Bruce Springsteen',
125 => 'Lion',
126 => 'Hedgehog',
127 => 'Coyote',
128 => 'Possum',
129 => 'Dolphin',
130 => 'Meerkat',
131 => 'Crocodile',
132 => 'Otter',
133 => 'Raccoon',
134 => 'Hyena',
135 => 'Jackal',
136 => 'Fox',
137 => 'Monkey',
138 => 'Panda',
139 => 'Deer',
140 => 'Black Leopard',
142 => 'Kangaroo',
143 => 'Tiger',
144 => 'Cheetah',
145 => 'Zebra',
146 => 'Giraffe',
147 => 'Jaguar',
149 => 'Wolf',
153 => 'Snake',
154 => 'Eagle',
155 => 'Vulture',
156 => 'Elk',
159 => 'Owl',
160 => 'Ox',
161 => 'Alligator',
162 => 'Panther',
163 => 'Parrot',
164 => 'Flamingo',
167 => 'Rhinoceros',
169 => 'Beaver',
171 => 'Walrus',
172 => 'Toad',
173 => 'Starfish',
174 => 'Shark',
175 => 'Reindeer',
176 => 'Rat',
177 => 'Rabbit',
178 => 'Mole',
179 => 'Lizard',
180 => 'Leopard',
181 => 'Koala',
182 => 'Jellyfish',
184 => 'Frog',
186 => 'Bat',
188 => 'Badger',
189 => 'Arctic wolf',
190 => 'White-Tailed Deer',
195 => 'Turtle',
196 => 'Tree frog',
205 => 'Skunk',
206 => 'Scorpion',
207 => 'Salamander',
208 => 'Potoroo',
209 => 'Poison Dart Frog',
210 => 'Piranha',
211 => 'Parakeet',
214 => 'Moth',
215 => 'Moose',
216 => 'Marmoset',
218 => 'Macaw',
219 => 'Lemur',
220 => 'Kodkod',
221 => 'Kingfisher',
222 => 'Jay',
223 => 'Iguana',
224 => 'Hummingbird',
225 => 'Hornbill',
226 => 'Hawk',
227 => 'Grouse',
228 => 'Flying Squirrel',
229 => 'Finch',
230 => 'Electric Eel',
232 => 'Chameleon',
233 => 'Catfish',
235 => 'Capybara',
237 => 'Butterfly',
240 => 'Brocket Deer',
241 => 'Bobcat',
242 => 'Bass',
243 => 'Bandicoot',
244 => 'Baboon',
245 => 'Bison',
246 => 'Red panda',
249 => 'Worm',
250 => 'Whydah',
251 => 'White-eye',
252 => 'Whistler',
253 => 'Weasel',
254 => 'Viper',
258 => 'Tamarin',
259 => 'Takin',
260 => 'Stick Bug',
261 => 'Starling',
262 => 'Spectacled Bear',
263 => 'Snow Leopard',
264 => 'Raven',
266 => 'Newt',
273 => 'Guinea Pig',
274 => 'Giant Panda',
277 => 'Falcon',
278 => 'Echidna',
286 => 'Cougar',
295 => 'Chinchilla',
296 => 'Chamois',
297 => 'Caribou',
300 => 'Buzzard',
301 => 'Bulbul',
302 => 'Brown Bear',
303 => 'Boa',
304 => 'Blue Sheep',
305 => 'Bird',
306 => 'Beetle',
307 => 'Bee',
308 => 'Black Bear',
309 => 'Mountain Cat',
310 => 'Salamander',
311 => 'Alpine Chough',
312 => 'Alpaca',
313 => 'African Wild Dog',
314 => 'African Buffalo',
315 => 'Accentor',
];
?>
<form action="generator.php?">
<label for="generate">Choose a subject</label>
<select name="subject" id="subject">
<?php
// Iterating through the product array
foreach($subjectlist as $item){
echo "<option value='$item'>$item</option>";
}
?>
</select>
<select name="action" id="action">
<?php
// Iterating through the product array
foreach($actionlist as $item){
echo "<option value='$item'>$item</option>";
}
?>
</select>
<input type="hidden" id="step" name="step" value="2">
<input type="submit" value="Submit">
</form>
</body>
<?php
echo "Step is".$step;
echo "subject is".$subject;
if ($step == 2)
{
echo "if check passed";
echo "subject is".$subject;
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
$promptmade = $subject." ".$action;
echo "the prompt is ".$promptmade;
curl_setopt($ch, CURLOPT_URL, 'https://api.pipeline.ai/v2/runs');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 45);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"pipeline_id\": \"pipeline_API Value",\n \"data\": [\n [\"'echo $promptmade;.'\"],\n { \"num_images\": 1, \"seed\": -1, \"diversity\": 3}\n ]\n}");
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization:=';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
$json = json_decode($result,true);
echo "<br><br><br> JASON: ".$json['result_preview'];
print_r(json_encode($result,$newarray));
header("Content-type: image/png");
$data = $json['result_preview'];
echo '<br><br><br> here is your image: <img src="data:image/png;base64,' . $data . '" />';
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
curl_close($ch);
echo "operations done";
}
}
?>
Looks like you need to call $json['result_preview'][0][0][0] for you to get expected result.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 months ago.
Improve this question
How to print option under selection_items
Array
(
[id] => 19
[is_core_field] => 0
[order_num] => 19
[name] => Accommodation Amenities
[slug] => accommodation_amenities
[description] =>
[type] => checkbox
[icon_image] =>
[is_required] => 0
[is_configuration_page] => 1
[is_search_configuration_page] => 1
[is_ordered] => 0
[is_hide_name] => 0
[for_admin_only] => 0
[on_exerpt_page] => 0
[on_listing_page] => 1
[on_search_form] => 1
[on_map] => 0
[advanced_search_form] => 0
[categories] => a:6:{i:0;s:4:"2801";i:1;s:4:"2874";i:2;s:4:"2852";i:3;s:4:"2849";i:4;s:4:"2850";i:5;s:4:"2851";}
[options] => a:4:{s:15:"selection_items";a:153:{i:5;s:23:"24-Hour Guest Reception";i:60;s:16:"24-Hour Security";i:138;s:18:"Accessible Parking";i:55;s:7:"Adapter";i:122;s:17:"Additional Toilet";i:30;s:16:"Air Conditioning";i:123;s:17:"Allergy-free room";i:142;s:11:"ATM On-Site";i:61;s:27:"Babysitting/child services ";i:46;s:7:"Balcony";i:48;s:8:"Bathrobe";i:45;s:7:"Bathtub";i:39;s:10:"Bar/Lounge";i:148;s:10:"Beachfront";i:84;s:9:"Body Soap";i:35;s:12:"Bridal Suite";i:13;s:17:"Business Services";i:25;s:18:"Cable/Satellite TV";i:27;s:4:"CCTV";i:56;s:20:"Cleaning Commodities";i:57;s:12:"Clothes Rack";i:14;s:23:"Complimentary Breakfast";i:6;s:24:"Complimentary Toiletries";i:32;s:9:"Concierge";i:116;s:11:"Conditioner";i:20;s:25:"Cribs & Cots for Children";i:22;s:19:"Curated Experiences";i:21;s:13:"Custom Offers";i:78;s:23:"Designated Smoking Area";i:132;s:8:"Detached";i:90;s:11:"Dining Area";i:118;s:23:"Drying Rack for Clothes";i:64;s:15:"Electric Kettle";i:11;s:20:"Electronics Chargers";i:36;s:15:"Elevator Access";i:114;s:35:"Entire Unit located on Ground Floor";i:17;s:25:"Exercise Facilities (Gym)";i:40;s:23:"Executive Lounge Access";i:96;s:26:"Express Check in/Check Out";i:92;s:12:"Family Rooms";i:49;s:3:"Fan";i:113;s:14:"Feather Pillow";i:44;s:17:"Fire Extinguisher";i:155;s:13:"First Aid Kit";i:8;s:17:"Flexible Checkout";i:152;s:44:"Food can be Delivered to Guest Accommodation";i:26;s:19:"Free Early Check-in";i:3;s:12:"Free Parking";i:2;s:9:"Free WIFI";i:77;s:6:"Fruits";i:93;s:6:"Garden";i:130;s:11:"Garden View";i:71;s:9:"Gift shop";i:115;s:5:"Grill";i:83;s:9:"Hairdryer";i:131;s:38:"Hand sanitizer in guest accommodation ";i:124;s:26:"Hardwood or Parquet Floors";i:7;s:17:"Healthy Breakfast";i:149;s:9:"Hot Water";i:157;s:7:"Heating";i:24;s:12:"Housekeeping";i:58;s:21:"Hypoallergenic pillow";i:103;s:23:"Increased Accessibility";i:125;s:20:"Inner Courtyard View";i:62;s:32:"Interconnected room(s) available";i:137;s:22:"Iron and Ironing Board";i:99;s:15:"Ironing Service";i:38;s:15:"Key Card Access";i:41;s:10:"Kids Meals";i:128;s:19:"Kid-friendly Buffet";i:156;s:28:"Kid activities/ Kid Friendly";i:33;s:11:"Kitchenette";i:94;s:13:"Landmark View";i:150;s:11:"Laptop Safe";i:15;s:16:"Laundry Services";i:67;s:6:"Linens";i:146;s:7:"Lockers";i:76;s:26:"Meeting/Banquet facilities";i:29;s:9:"Microwave";i:63;s:13:"Mountain View";i:89;s:12:"Mosquito Net";i:18;s:9:"Newspaper";i:54;s:15:"No Pets Allowed";i:120;s:22:"No Single-Use Plastics";i:53;s:10:"No Smoking";i:109;s:18:"Non-Feather Pillow";i:119;s:27:"Non-Smoking Rooms Available";i:28;s:18:"On-site Restaurant";i:70;s:17:"Outdoor furniture";i:98;s:19:"Outdoor Dining Area";i:121;s:4:"Oven";i:153;s:17:"Outdoor Fireplace";i:95;s:14:"Packed Lunches";i:80;s:11:"Pants Press";i:23;s:18:"Pet-friendly Rooms";i:105;s:11:"Picnic Area";i:85;s:25:"Physical Distancing Rules";i:133;s:29:"Private Apartment in Building";i:134;s:16:"Private Bathroom";i:136;s:14:"Private Beach ";i:91;s:26:"Private Check-In/Check-Out";i:72;s:16:"Private Entrance";i:140;s:17:"Quiet Street View";i:144;s:10:"Restaurant";i:10;s:12:"Refrigerator";i:129;s:10:"River View";i:145;s:7:"Rooftop";i:4;s:12:"Room Service";i:65;s:4:"Safe";i:34;s:18:"Safety Deposit Box";i:147;s:5:"Sauna";i:73;s:8:"Sea view";i:74;s:12:"Seating Area";i:100;s:15:"Secured Parking";i:112;s:13:"Semi-detached";i:101;s:15:"Shared Bathroom";i:102;s:21:"Shared Lounge/TV Area";i:66;s:7:"Shampoo";i:106;s:9:"Shoeshine";i:68;s:6:"Shower";i:69;s:10:"Shower cap";i:31;s:15:"Shuttle Service";i:37;s:12:"Smoke Alarms";i:81;s:9:"Snack Bar";i:88;s:19:"Socket near the bed";i:50;s:4:"Sofa";i:16;s:24:"Spa & Wellness Amenities";i:59;s:18:"Special Diet Menus";i:154;s:66:"Staff follow all safety protocols as directed by local authorities";i:19;s:18:"Storage Available ";i:111;s:8:"Stovetop";i:97;s:14:"Street Parking";i:9;s:13:"Swimming Pool";i:86;s:16:"Tea/coffee maker";i:43;s:9:"Telephone";i:51;s:13:"Terrace/Patio";i:107;s:17:"Tile/Marble Floor";i:108;s:7:"Toaster";i:126;s:12:"Toilet Paper";i:139;s:10:"Toiletries";i:42;s:6:"Towels";i:143;s:2:"TV";i:75;s:10:"Trash Cans";i:117;s:33:"Upper Floors accessible by Stairs";i:104;s:13:"Valet Parking";i:151;s:19:"VIP Room Facilities";i:47;s:14:"Walk-in Shower";i:141;s:15:"Washing Machine";i:52;s:15:"Wardrobe/Closet";i:79;s:16:"Wedding services";i:82;s:6:"Window";i:135;s:12:"Wine Glasses";i:1;s:18:"Wheel Chair Access";}s:11:"icon_images";a:153:{i:5;s:0:"";i:60;s:0:"";i:138;s:0:"";i:55;s:0:"";i:122;s:0:"";i:30;s:0:"";i:123;s:0:"";i:142;s:0:"";i:61;s:0:"";i:46;s:0:"";i:48;s:0:"";i:45;s:0:"";i:39;s:0:"";i:148;s:0:"";i:84;s:0:"";i:35;s:0:"";i:13;s:0:"";i:25;s:0:"";i:27;s:0:"";i:56;s:0:"";i:57;s:0:"";i:14;s:0:"";i:6;s:0:"";i:32;s:0:"";i:116;s:0:"";i:20;s:0:"";i:22;s:0:"";i:21;s:0:"";i:78;s:0:"";i:132;s:0:"";i:90;s:0:"";i:118;s:0:"";i:64;s:0:"";i:11;s:0:"";i:36;s:0:"";i:114;s:0:"";i:17;s:0:"";i:40;s:0:"";i:96;s:0:"";i:92;s:0:"";i:49;s:0:"";i:113;s:0:"";i:44;s:0:"";i:155;s:0:"";i:8;s:0:"";i:152;s:0:"";i:26;s:0:"";i:3;s:0:"";i:2;s:0:"";i:77;s:0:"";i:93;s:0:"";i:130;s:0:"";i:71;s:0:"";i:115;s:0:"";i:83;s:0:"";i:131;s:0:"";i:124;s:0:"";i:7;s:0:"";i:149;s:0:"";i:157;s:0:"";i:24;s:0:"";i:58;s:0:"";i:103;s:0:"";i:125;s:0:"";i:62;s:0:"";i:137;s:0:"";i:99;s:0:"";i:38;s:0:"";i:41;s:0:"";i:128;s:0:"";i:156;s:0:"";i:33;s:0:"";i:94;s:0:"";i:150;s:0:"";i:15;s:0:"";i:67;s:0:"";i:146;s:0:"";i:76;s:0:"";i:29;s:0:"";i:63;s:0:"";i:89;s:0:"";i:18;s:0:"";i:54;s:0:"";i:120;s:0:"";i:53;s:0:"";i:109;s:0:"";i:119;s:0:"";i:28;s:0:"";i:70;s:0:"";i:98;s:0:"";i:121;s:0:"";i:153;s:0:"";i:95;s:0:"";i:80;s:0:"";i:23;s:0:"";i:105;s:0:"";i:85;s:0:"";i:133;s:0:"";i:134;s:0:"";i:136;s:0:"";i:91;s:0:"";i:72;s:0:"";i:140;s:0:"";i:144;s:0:"";i:10;s:0:"";i:129;s:0:"";i:145;s:0:"";i:4;s:0:"";i:65;s:0:"";i:34;s:0:"";i:147;s:0:"";i:73;s:0:"";i:74;s:0:"";i:100;s:0:"";i:112;s:0:"";i:101;s:0:"";i:102;s:0:"";i:66;s:0:"";i:106;s:0:"";i:68;s:0:"";i:69;s:0:"";i:31;s:0:"";i:37;s:0:"";i:81;s:0:"";i:88;s:0:"";i:50;s:0:"";i:16;s:0:"";i:59;s:0:"";i:154;s:0:"";i:19;s:0:"";i:111;s:0:"";i:97;s:0:"";i:9;s:0:"";i:86;s:0:"";i:43;s:0:"";i:51;s:0:"";i:107;s:0:"";i:108;s:0:"";i:126;s:0:"";i:139;s:0:"";i:42;s:0:"";i:143;s:0:"";i:75;s:0:"";i:117;s:0:"";i:104;s:0:"";i:151;s:0:"";i:47;s:0:"";i:141;s:0:"";i:52;s:0:"";i:79;s:0:"";i:82;s:0:"";i:135;s:0:"";i:1;s:0:"";}s:17:"how_display_items";s:7:"checked";s:14:"columns_number";s:1:"3";}
[search_options] =>
[group_id] => 0
)
How can i get the result from options =>"selection_items". Please guide me, i am using wordpress. thanks in advance
WordPress serializes arrays and objexts when stored in the database.
You need to unserialize the value of options. For example:
unserialize($array['options']);
WordPress also includes a maybe_unserialize function that does the same job, but it includes a condition to only unserialize data that has been serialized.
maybe_unserialize($array['options']);
Once you've unserialized the options it will return the following array:
array (
'selection_items' =>
array (
5 => '24-Hour Guest Reception',
60 => '24-Hour Security',
138 => 'Accessible Parking',
55 => 'Adapter',
122 => 'Additional Toilet',
30 => 'Air Conditioning',
123 => 'Allergy-free room',
142 => 'ATM On-Site',
61 => 'Babysitting/child services ',
46 => 'Balcony',
48 => 'Bathrobe',
45 => 'Bathtub',
39 => 'Bar/Lounge',
148 => 'Beachfront',
84 => 'Body Soap',
35 => 'Bridal Suite',
13 => 'Business Services',
25 => 'Cable/Satellite TV',
27 => 'CCTV',
56 => 'Cleaning Commodities',
57 => 'Clothes Rack',
14 => 'Complimentary Breakfast',
6 => 'Complimentary Toiletries',
32 => 'Concierge',
116 => 'Conditioner',
20 => 'Cribs & Cots for Children',
22 => 'Curated Experiences',
21 => 'Custom Offers',
78 => 'Designated Smoking Area',
132 => 'Detached',
90 => 'Dining Area',
118 => 'Drying Rack for Clothes',
64 => 'Electric Kettle',
11 => 'Electronics Chargers',
36 => 'Elevator Access',
114 => 'Entire Unit located on Ground Floor',
17 => 'Exercise Facilities (Gym)',
40 => 'Executive Lounge Access',
96 => 'Express Check in/Check Out',
92 => 'Family Rooms',
49 => 'Fan',
113 => 'Feather Pillow',
44 => 'Fire Extinguisher',
155 => 'First Aid Kit',
8 => 'Flexible Checkout',
152 => 'Food can be Delivered to Guest Accommodation',
26 => 'Free Early Check-in',
3 => 'Free Parking',
2 => 'Free WIFI',
77 => 'Fruits',
93 => 'Garden',
130 => 'Garden View',
71 => 'Gift shop',
115 => 'Grill',
83 => 'Hairdryer',
131 => 'Hand sanitizer in guest accommodation ',
124 => 'Hardwood or Parquet Floors',
7 => 'Healthy Breakfast',
149 => 'Hot Water',
157 => 'Heating',
24 => 'Housekeeping',
58 => 'Hypoallergenic pillow',
103 => 'Increased Accessibility',
125 => 'Inner Courtyard View',
62 => 'Interconnected room(s) available',
137 => 'Iron and Ironing Board',
99 => 'Ironing Service',
38 => 'Key Card Access',
41 => 'Kids Meals',
128 => 'Kid-friendly Buffet',
156 => 'Kid activities/ Kid Friendly',
33 => 'Kitchenette',
94 => 'Landmark View',
150 => 'Laptop Safe',
15 => 'Laundry Services',
67 => 'Linens',
146 => 'Lockers',
76 => 'Meeting/Banquet facilities',
29 => 'Microwave',
63 => 'Mountain View',
89 => 'Mosquito Net',
18 => 'Newspaper',
54 => 'No Pets Allowed',
120 => 'No Single-Use Plastics',
53 => 'No Smoking',
109 => 'Non-Feather Pillow',
119 => 'Non-Smoking Rooms Available',
28 => 'On-site Restaurant',
70 => 'Outdoor furniture',
98 => 'Outdoor Dining Area',
121 => 'Oven',
153 => 'Outdoor Fireplace',
95 => 'Packed Lunches',
80 => 'Pants Press',
23 => 'Pet-friendly Rooms',
105 => 'Picnic Area',
85 => 'Physical Distancing Rules',
133 => 'Private Apartment in Building',
134 => 'Private Bathroom',
136 => 'Private Beach ',
91 => 'Private Check-In/Check-Out',
72 => 'Private Entrance',
140 => 'Quiet Street View',
144 => 'Restaurant',
10 => 'Refrigerator',
129 => 'River View',
145 => 'Rooftop',
4 => 'Room Service',
65 => 'Safe',
34 => 'Safety Deposit Box',
147 => 'Sauna',
73 => 'Sea view',
74 => 'Seating Area',
100 => 'Secured Parking',
112 => 'Semi-detached',
101 => 'Shared Bathroom',
102 => 'Shared Lounge/TV Area',
66 => 'Shampoo',
106 => 'Shoeshine',
68 => 'Shower',
69 => 'Shower cap',
31 => 'Shuttle Service',
37 => 'Smoke Alarms',
81 => 'Snack Bar',
88 => 'Socket near the bed',
50 => 'Sofa',
16 => 'Spa & Wellness Amenities',
59 => 'Special Diet Menus',
154 => 'Staff follow all safety protocols as directed by local authorities',
19 => 'Storage Available ',
111 => 'Stovetop',
97 => 'Street Parking',
9 => 'Swimming Pool',
86 => 'Tea/coffee maker',
43 => 'Telephone',
51 => 'Terrace/Patio',
107 => 'Tile/Marble Floor',
108 => 'Toaster',
126 => 'Toilet Paper',
139 => 'Toiletries',
42 => 'Towels',
143 => 'TV',
75 => 'Trash Cans',
117 => 'Upper Floors accessible by Stairs',
104 => 'Valet Parking',
151 => 'VIP Room Facilities',
47 => 'Walk-in Shower',
141 => 'Washing Machine',
52 => 'Wardrobe/Closet',
79 => 'Wedding services',
82 => 'Window',
135 => 'Wine Glasses',
1 => 'Wheel Chair Access',
),
'icon_images' =>
array (
5 => '',
60 => '',
138 => '',
55 => '',
122 => '',
30 => '',
123 => '',
142 => '',
61 => '',
46 => '',
48 => '',
45 => '',
39 => '',
148 => '',
84 => '',
35 => '',
13 => '',
25 => '',
27 => '',
56 => '',
57 => '',
14 => '',
6 => '',
32 => '',
116 => '',
20 => '',
22 => '',
21 => '',
78 => '',
132 => '',
90 => '',
118 => '',
64 => '',
11 => '',
36 => '',
114 => '',
17 => '',
40 => '',
96 => '',
92 => '',
49 => '',
113 => '',
44 => '',
155 => '',
8 => '',
152 => '',
26 => '',
3 => '',
2 => '',
77 => '',
93 => '',
130 => '',
71 => '',
115 => '',
83 => '',
131 => '',
124 => '',
7 => '',
149 => '',
157 => '',
24 => '',
58 => '',
103 => '',
125 => '',
62 => '',
137 => '',
99 => '',
38 => '',
41 => '',
128 => '',
156 => '',
33 => '',
94 => '',
150 => '',
15 => '',
67 => '',
146 => '',
76 => '',
29 => '',
63 => '',
89 => '',
18 => '',
54 => '',
120 => '',
53 => '',
109 => '',
119 => '',
28 => '',
70 => '',
98 => '',
121 => '',
153 => '',
95 => '',
80 => '',
23 => '',
105 => '',
85 => '',
133 => '',
134 => '',
136 => '',
91 => '',
72 => '',
140 => '',
144 => '',
10 => '',
129 => '',
145 => '',
4 => '',
65 => '',
34 => '',
147 => '',
73 => '',
74 => '',
100 => '',
112 => '',
101 => '',
102 => '',
66 => '',
106 => '',
68 => '',
69 => '',
31 => '',
37 => '',
81 => '',
88 => '',
50 => '',
16 => '',
59 => '',
154 => '',
19 => '',
111 => '',
97 => '',
9 => '',
86 => '',
43 => '',
51 => '',
107 => '',
108 => '',
126 => '',
139 => '',
42 => '',
143 => '',
75 => '',
117 => '',
104 => '',
151 => '',
47 => '',
141 => '',
52 => '',
79 => '',
82 => '',
135 => '',
1 => '',
),
'how_display_items' => 'checked',
'columns_number' => '3',
)
i have a mp3 class to read mp3s for my site. (i cannot install the module since its a shared hosting). i upload the mp3 and then the system read it using my class and insert into my mysql the file name and location, and the basic tag (artist, song name, album). the mysql insert is ok but i have problem with the strings i am inserting.
here's my code: http://pastebin.com/fXsm0c3T
<?php
class Id3 {
private $tags = array(
'TALB' => 'album', 'TCON' => 'genre', 'TENC' => 'encoder',
'TIT2' => 'title', 'TPE1' => 'artist', 'TPE2' => 'ensemble', 'TYER' => 'year', 'TCOM' => 'composer',
'TCOP' => 'copyright', 'TRCK' => 'track', 'WXXX' => 'url',
'COMM' => 'comment'
);
private $genre = array(
0 => 'Blues', 1 => 'Classic Rock', 2 => 'Country', 3 => 'Dance', 4 => 'Disco', 5 => 'Funk', 6 => 'Grunge', 7 => 'Hip-Hop', 8 => 'Jazz', 9 => 'Metal', 10 => 'New Age', 11 => 'Oldies', 12 => 'Other',
13 => 'Pop', 14 => 'R&B', 15 => 'Rap', 16 => 'Reggae', 17 => 'Rock', 18 => 'Techno', 19 => 'Industrial', 20 => 'Alternative', 21 => 'Ska', 22 => 'Death Metal', 23 => 'Pranks', 24 => 'Soundtrack', 25 => 'Euro-Techno', 26 => 'Ambient', 27 => 'Trip-Hop', 28 => 'Vocal',
29 => 'Jazz+Funk', 30 => 'Fusion', 31 => 'Trance', 32 => 'Classical', 33 => 'Instrumental', 34 => 'Acid', 35 => 'House',
36 => 'Game', 37 => 'Sound Clip', 38 => 'Gospel', 39 => 'Noise', 40 => 'Alternative Rock', 41 => 'Bass', 42 => 'Soul', 43 => 'Punk', 44 => 'Space', 45 => 'Meditative', 46 => 'Instrumental Pop', 47 => 'Instrumental Rock', 48 => 'Ethnic',
49 => 'Gothic', 50 => 'Darkwave', 51 => 'Techno-Industrial', 52 => 'Electronic', 53 => 'Pop-Folk', 54 => 'Eurodance', 55 => 'Dream', 56 => 'Southern Rock', 57 => 'Comedy', 58 => 'Cult', 59 => 'Gangsta', 60 => 'Top 40', 61 => 'Christian Rap', 62 => 'Pop/Funk', 63 => 'Jungle', 64 => 'Native US', 65 => 'Cabaret', 66 => 'New Wave', 67 => 'Psychadelic', 68 => 'Rave', 69 => 'Showtunes', 70 => 'Trailer', 71 => 'Lo-Fi', 72 => 'Tribal', 73 => 'Acid Punk', 74 => 'Acid Jazz', 75 => 'Polka', 76 => 'Retro', 77 => 'Musical', 78 => 'Rock & Roll', 79 => 'Hard Rock', 80 => 'Folk', 81 => 'Folk-Rock', 82 => 'National Folk', 83 => 'Swing', 84 => 'Fast Fusion', 85 => 'Bebob', 86 => 'Latin',
87 => 'Revival', 88 => 'Celtic', 89 => 'Bluegrass', 90 => 'Avantgarde', 91 => 'Gothic Rock', 92 => 'Progressive Rock', 93 => 'Psychedelic Rock', 94 => 'Symphonic Rock', 95 => 'Slow Rock', 96 => 'Big Band', 97 => 'Chorus', 98 => 'Easy Listening', 99 => 'Acoustic',
100 => 'Humour', 101 => 'Speech', 102 => 'Chanson', 103 => 'Opera', 104 => 'Chamber Music', 105 => 'Sonata', 106 => 'Symphony', 107 => 'Booty Bass', 108 => 'Primus', 109 => 'Porn Groove', 110 => 'Satire', 111 => 'Slow Jam', 112 => 'Club',
113 => 'Tango', 114 => 'Samba', 115 => 'Folklore', 116 => 'Ballad', 117 => 'Power Ballad', 118 => 'Rhytmic Soul', 119 => 'Freestyle', 120 => 'Duet', 121 => 'Punk Rock', 122 => 'Drum Solo', 123 => 'Acapella', 124 => 'Euro-House',
125 => 'Dance Hall', 126 => 'Goa', 127 => 'Drum & Bass', 128 => 'Club-House', 129 => 'Hardcore', 130 => 'Terror', 131 => 'Indie', 132 => 'BritPop', 133 => 'Negerpunk', 134 => 'Polsk Punk', 135 => 'Beat', 136 => 'Christian Gangsta Rap', 137 => 'Heavy Metal', 138 => 'Black Metal', 139 => 'Crossover', 140 => 'Contemporary Christian', 141 => 'Christian Rock', 142 => 'Merengue', 143 => 'Salsa', 144 => 'Trash Metal', 145 => 'Anime', 146 => 'Jpop', 147 => 'Synthpop'
);
public function __construct() {
$this->info = '';
}
private function getId3() {
$handle = fopen($this->file, 'r');
$head = fread($handle,10);
$head = unpack("a3signature/c1version_major/c1version_minor/c1flags/Nsize", $head);
$result = array();
for ($i = 0; $i<5; $i++){
$tag = trim(fread($handle, 6));
if (!isset($this->tags[$tag])) continue;
$size = fread($handle, 2);
$size = unpack('n', $size); $size = $size[1]+2;
$value = fread($handle, $size);
$this->info[$this->tags[$tag]] = $value;
} fclose($handle);
}
public function load($file) {
$this->file = $file; $this->getId3(); }
}
$id3 = new Id3();
$id3->load('mp3.mp3');
print_R($id3->info);
now, when i read the value i get this:
Array
(
[genre] => ��Rock
[title] => ��Walk
[artist] => ��Foo Fighters
[album] => ��Wasting Light
)
what is wrong with my code?
based on your code, the $value needs to be trim or converted to UTF (I prefer converting to UTF).
I added function that will check which UTF is the mp3 and parse it correctly:
$value = $this->filter($value, $tag); // convert to UTF or else that is why you have weird chars
Here's a readable code.
<?php
class Id3 {
private $tags = array(
'TALB' => 'album',
'TCON' => 'genre',
'TENC' => 'encoder',
'TIT2' => 'title',
'TPE1' => 'artist',
'TPE2' => 'ensemble',
'TYER' => 'year',
'TCOM' => 'composer',
'TCOP' => 'copyright',
'TRCK' => 'track',
'WXXX' => 'url',
'COMM' => 'comment'
);
private $genre = array(
0 => 'Blues',
1 => 'Classic Rock',
2 => 'Country',
3 => 'Dance',
4 => 'Disco',
5 => 'Funk',
6 => 'Grunge',
7 => 'Hip-Hop',
8 => 'Jazz',
9 => 'Metal',
10 => 'New Age',
11 => 'Oldies',
12 => 'Other',
13 => 'Pop',
14 => 'R&B',
15 => 'Rap',
16 => 'Reggae',
17 => 'Rock',
18 => 'Techno',
19 => 'Industrial',
20 => 'Alternative',
21 => 'Ska',
22 => 'Death Metal',
23 => 'Pranks',
24 => 'Soundtrack',
25 => 'Euro-Techno',
26 => 'Ambient',
27 => 'Trip-Hop',
28 => 'Vocal',
29 => 'Jazz+Funk',
30 => 'Fusion',
31 => 'Trance',
32 => 'Classical',
33 => 'Instrumental',
34 => 'Acid',
35 => 'House',
36 => 'Game',
37 => 'Sound Clip',
38 => 'Gospel',
39 => 'Noise',
40 => 'Alternative Rock',
41 => 'Bass',
42 => 'Soul',
43 => 'Punk',
44 => 'Space',
45 => 'Meditative',
46 => 'Instrumental Pop',
47 => 'Instrumental Rock',
48 => 'Ethnic',
49 => 'Gothic',
50 => 'Darkwave',
51 => 'Techno-Industrial',
52 => 'Electronic',
53 => 'Pop-Folk',
54 => 'Eurodance',
55 => 'Dream',
56 => 'Southern Rock',
57 => 'Comedy',
58 => 'Cult',
59 => 'Gangsta',
60 => 'Top 40',
61 => 'Christian Rap',
62 => 'Pop/Funk',
63 => 'Jungle',
64 => 'Native US',
65 => 'Cabaret',
66 => 'New Wave',
67 => 'Psychadelic',
68 => 'Rave',
69 => 'Showtunes',
70 => 'Trailer',
71 => 'Lo-Fi',
72 => 'Tribal',
73 => 'Acid Punk',
74 => 'Acid Jazz',
75 => 'Polka',
76 => 'Retro',
77 => 'Musical',
78 => 'Rock & Roll',
79 => 'Hard Rock',
80 => 'Folk',
81 => 'Folk-Rock',
82 => 'National Folk',
83 => 'Swing',
84 => 'Fast Fusion',
85 => 'Bebob',
86 => 'Latin',
87 => 'Revival',
88 => 'Celtic',
89 => 'Bluegrass',
90 => 'Avantgarde',
91 => 'Gothic Rock',
92 => 'Progressive Rock',
93 => 'Psychedelic Rock',
94 => 'Symphonic Rock',
95 => 'Slow Rock',
96 => 'Big Band',
97 => 'Chorus',
98 => 'Easy Listening',
99 => 'Acoustic',
100 => 'Humour',
101 => 'Speech',
102 => 'Chanson',
103 => 'Opera',
104 => 'Chamber Music',
105 => 'Sonata',
106 => 'Symphony',
107 => 'Booty Bass',
108 => 'Primus',
109 => 'Porn Groove',
110 => 'Satire',
111 => 'Slow Jam',
112 => 'Club',
113 => 'Tango',
114 => 'Samba',
115 => 'Folklore',
116 => 'Ballad',
117 => 'Power Ballad',
118 => 'Rhytmic Soul',
119 => 'Freestyle',
120 => 'Duet',
121 => 'Punk Rock',
122 => 'Drum Solo',
123 => 'Acapella',
124 => 'Euro-House',
125 => 'Dance Hall',
126 => 'Goa',
127 => 'Drum & Bass',
128 => 'Club-House',
129 => 'Hardcore',
130 => 'Terror',
131 => 'Indie',
132 => 'BritPop',
133 => 'Negerpunk',
134 => 'Polsk Punk',
135 => 'Beat',
136 => 'Christian Gangsta Rap',
137 => 'Heavy Metal',
138 => 'Black Metal',
139 => 'Crossover',
140 => 'Contemporary Christian',
141 => 'Christian Rock',
142 => 'Merengue',
143 => 'Salsa',
144 => 'Trash Metal',
145 => 'Anime',
146 => 'Jpop',
147 => 'Synthpop'
);
private $file;
private $info;
public function __construct() {
$this->info = array(
'genre' => 'unknow',
'title' => 'unknow',
'artist' => 'unknow',
'album' => 'unknow',
);
}
private function filter($tag, $type) {
if ($type == 'COMM') {
$tag = substr($tag, 0, 3) . substr($tag, 10);
}
if(ord($tag[2]) == 0) {
return iconv('UTF-8', 'ISO-8859-1', substr($tag, 3));
}
elseif(ord($tag[2]) == 1) {
return iconv('UTF-16LE', 'UTF-8', substr($tag, 5));
}
elseif(ord($tag[2]) == 2) {
return iconv('UTF-16BE', 'UTF-8', substr($tag, 5));
}
elseif(ord($tag[2]) == 3) {
return substr($tag, 3);
}
return false;
}
private function getId3() {
$handle = fopen($this->file, 'rb');
$head = fread($handle, 10);
$head = unpack("a3signature/c1version_major/c1version_minor/c1flags/Nsize", $head);
if (!$head['signature'] == 'ID3') {
fclose($handle);
return false;
}
$result = array();
for ($i = 0; $i < 22; $i++) { //22 most popular tags, you had 5 therefore only the first five.
$tag = rtrim(fread($handle, 6));
if (!isset($this->tags[$tag])) {
continue;
}
$size = fread($handle, 2);
$size = unpack('n', $size);
$size = $size[1]+2;
$value = fread($handle, $size);
$value = $this->filter($value, $tag); // convert to UTF or else that is why you have weird chars
$this->info[$this->tags[$tag]] = $value;
}
fclose($handle);
}
public function load($file) {
$this->file = $file;
$this->getId3();
}
public function getInfo() {
return $this->info;
}
}
$id3 = new Id3();
$id3->load('mp3.mp3');
print_R($id3->getInfo());
To get more information about tags, read this wiki article: http://en.wikipedia.org/wiki/ID3
Why does this work?
date_default_timezone_set('Australia/Currie');
But this doesn't seem to take any effect at all?
date_default_timezone_set('UTC');
This value doesn't change when setting the timezone to UTC:
echo date('Y-m-d H:i:s', time());
I'm using php 5.2.13, and the timezone of my server is:
$server_tz = date_default_timezone_get();
echo $server_tz; //outputs 'America/Guayaquil'
This is the original code:
echo time() . "<br>\n";
date_default_timezone_set('UTC');
echo time() . "<br>\n";
Output:
1317235130
1317235130
The problem is that you're displaying time(), which is a UNIX timestamp based on GMT/UTC. That’s why it doesn’t change. date() on the other hand, formats the time based on that timestamp.
A timestamp is the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
echo date('Y-m-d H:i:s T', time()) . "<br>\n";
date_default_timezone_set('UTC');
echo date('Y-m-d H:i:s T', time()) . "<br>\n";
UTC is definitely a valid timezone. It is simply an abbreviation for Coordinated Universal Time. In addition, remember that date_default_timezone_set accepts one of the following values:
$timezones=array(
"America/Adak",
"America/Argentina/Buenos_Aires",
"America/Argentina/La_Rioja",
"America/Argentina/San_Luis",
"America/Atikokan",
"America/Belem",
"America/Boise",
"America/Caracas",
"America/Chihuahua",
"America/Cuiaba",
"America/Denver",
"America/El_Salvador",
"America/Godthab",
"America/Guatemala",
"America/Hermosillo",
"America/Indiana/Tell_City",
"America/Inuvik",
"America/Kentucky/Louisville",
"America/Lima",
"America/Managua",
"America/Mazatlan",
"America/Mexico_City",
"America/Montreal",
"America/Nome",
"America/Ojinaga",
"America/Port-au-Prince",
"America/Rainy_River",
"America/Rio_Branco",
"America/Santo_Domingo",
"America/St_Barthelemy",
"America/St_Vincent",
"America/Tijuana",
"America/Whitehorse",
"America/Anchorage",
"America/Argentina/Catamarca",
"America/Argentina/Mendoza",
"America/Argentina/Tucuman",
"America/Atka",
"America/Belize",
"America/Buenos_Aires",
"America/Catamarca",
"America/Coral_Harbour",
"America/Curacao",
"America/Detroit",
"America/Ensenada",
"America/Goose_Bay",
"America/Guayaquil",
"America/Indiana/Indianapolis",
"America/Indiana/Vevay",
"America/Iqaluit",
"America/Kentucky/Monticello",
"America/Los_Angeles",
"America/Manaus",
"America/Mendoza",
"America/Miquelon",
"America/Montserrat",
"America/Noronha",
"America/Panama",
"America/Port_of_Spain",
"America/Rankin_Inlet",
"America/Rosario",
"America/Sao_Paulo",
"America/St_Johns",
"America/Swift_Current",
"America/Toronto",
"America/Winnipeg",
"America/Anguilla",
"America/Argentina/ComodRivadavia",
"America/Argentina/Rio_Gallegos",
"America/Argentina/Ushuaia",
"America/Bahia",
"America/Blanc-Sablon",
"America/Cambridge_Bay",
"America/Cayenne",
"America/Cordoba",
"America/Danmarkshavn",
"America/Dominica",
"America/Fort_Wayne",
"America/Grand_Turk",
"America/Guyana",
"America/Indiana/Knox",
"America/Indiana/Vincennes",
"America/Jamaica",
"America/Knox_IN",
"America/Louisville",
"America/Marigot",
"America/Menominee",
"America/Moncton",
"America/Nassau",
"America/North_Dakota/Beulah",
"America/Pangnirtung",
"America/Porto_Acre",
"America/Recife",
"America/Santa_Isabel",
"America/Scoresbysund",
"America/St_Kitts",
"America/Tegucigalpa",
"America/Tortola",
"America/Yakutat",
"America/Antigua",
"America/Argentina/Cordoba",
"America/Argentina/Salta",
"America/Aruba",
"America/Bahia_Banderas",
"America/Boa_Vista",
"America/Campo_Grande",
"America/Cayman",
"America/Costa_Rica",
"America/Dawson",
"America/Edmonton",
"America/Fortaleza",
"America/Grenada",
"America/Halifax",
"America/Indiana/Marengo",
"America/Indiana/Winamac",
"America/Jujuy",
"America/Kralendijk",
"America/Lower_Princes",
"America/Martinique",
"America/Merida",
"America/Monterrey",
"America/New_York",
"America/North_Dakota/Center",
"America/Paramaribo",
"America/Porto_Velho",
"America/Regina",
"America/Santarem",
"America/Shiprock",
"America/St_Lucia",
"America/Thule",
"America/Vancouver",
"America/Yellowknife",
"America/Araguaina",
"America/Argentina/Jujuy",
"America/Argentina/San_Juan",
"America/Asuncion",
"America/Barbados",
"America/Bogota",
"America/Cancun",
"America/Chicago",
"America/Creston",
"America/Dawson_Creek",
"America/Eirunepe",
"America/Glace_Bay",
"America/Guadeloupe",
"America/Havana",
"America/Indiana/Petersburg",
"America/Indianapolis",
"America/Juneau",
"America/La_Paz",
"America/Maceio",
"America/Matamoros",
"America/Metlakatla",
"America/Montevideo",
"America/Nipigon",
"America/North_Dakota/New_Salem",
"America/Phoenix",
"America/Puerto_Rico",
"America/Resolute",
"America/Santiago",
"America/Sitka",
"America/St_Thomas",
"America/Thunder_Bay",
"America/Virgin",
"Indian/Antananarivo",
"Indian/Kerguelen",
"Indian/Reunion",
"Australia/ACT",
"Australia/Currie",
"Australia/Lindeman",
"Australia/Perth",
"Australia/Victoria",
"Europe/Amsterdam",
"Europe/Berlin",
"Europe/Chisinau",
"Europe/Helsinki",
"Europe/Kiev",
"Europe/Madrid",
"Europe/Moscow",
"Europe/Prague",
"Europe/Sarajevo",
"Europe/Tallinn",
"Europe/Vatican",
"Europe/Zagreb",
"Pacific/Apia",
"Pacific/Efate",
"Pacific/Galapagos",
"Pacific/Johnston",
"Pacific/Marquesas",
"Pacific/Noumea",
"Pacific/Ponape",
"Pacific/Tahiti",
"Pacific/Wallis",
"Indian/Chagos",
"Indian/Mahe",
"Australia/Adelaide",
"Australia/Darwin",
"Australia/Lord_Howe",
"Australia/Queensland",
"Australia/West",
"Europe/Andorra",
"Europe/Bratislava",
"Europe/Copenhagen",
"Europe/Isle_of_Man",
"Europe/Lisbon",
"Europe/Malta",
"Europe/Nicosia",
"Europe/Riga",
"Europe/Simferopol",
"Europe/Tirane",
"Europe/Vienna",
"Europe/Zaporozhye",
"Pacific/Auckland",
"Pacific/Enderbury",
"Pacific/Gambier",
"Pacific/Kiritimati",
"Pacific/Midway",
"Pacific/Pago_Pago",
"Pacific/Port_Moresby",
"Pacific/Tarawa",
"Pacific/Yap",
"Africa/Abidjan",
"Africa/Asmera",
"Africa/Blantyre",
"Africa/Ceuta",
"Africa/Douala",
"Africa/Johannesburg",
"Africa/Kinshasa",
"Africa/Lubumbashi",
"Africa/Mbabane",
"Africa/Niamey",
"Africa/Timbuktu",
"Africa/Accra",
"Africa/Bamako",
"Africa/Brazzaville",
"Africa/Conakry",
"Africa/El_Aaiun",
"Africa/Juba",
"Africa/Lagos",
"Africa/Lusaka",
"Africa/Mogadishu",
"Africa/Nouakchott",
"Africa/Tripoli",
"Africa/Addis_Ababa",
"Africa/Bangui",
"Africa/Bujumbura",
"Africa/Dakar",
"Africa/Freetown",
"Africa/Kampala",
"Africa/Libreville",
"Africa/Malabo",
"Africa/Monrovia",
"Africa/Ouagadougou",
"Africa/Tunis",
"Africa/Algiers",
"Africa/Banjul",
"Africa/Cairo",
"Africa/Dar_es_Salaam",
"Africa/Gaborone",
"Africa/Khartoum",
"Africa/Lome",
"Africa/Maputo",
"Africa/Nairobi",
"Africa/Porto-Novo",
"Africa/Windhoek",
"Africa/Asmara",
"Africa/Bissau",
"Africa/Casablanca",
"Africa/Djibouti",
"Africa/Harare",
"Africa/Kigali",
"Africa/Luanda",
"Africa/Maseru",
"Africa/Ndjamena",
"Africa/Sao_Tome",
"Atlantic/Azores",
"Atlantic/Faroe",
"Atlantic/St_Helena",
"Atlantic/Bermuda",
"Atlantic/Jan_Mayen",
"Atlantic/Stanley",
"Atlantic/Canary",
"Atlantic/Madeira",
"Atlantic/Cape_Verde",
"Atlantic/Reykjavik",
"Atlantic/Faeroe",
"Atlantic/South_Georgia",
"Asia/Aden",
"Asia/Aqtobe",
"Asia/Baku",
"Asia/Calcutta",
"Asia/Dacca",
"Asia/Dushanbe",
"Asia/Hong_Kong",
"Asia/Jayapura",
"Asia/Kashgar",
"Asia/Kuala_Lumpur",
"Asia/Magadan",
"Asia/Novokuznetsk",
"Asia/Pontianak",
"Asia/Riyadh",
"Asia/Shanghai",
"Asia/Tehran",
"Asia/Ujung_Pandang",
"Asia/Vladivostok",
"Asia/Almaty",
"Asia/Ashgabat",
"Asia/Bangkok",
"Asia/Choibalsan",
"Asia/Damascus",
"Asia/Gaza",
"Asia/Hovd",
"Asia/Jerusalem",
"Asia/Kathmandu",
"Asia/Kuching",
"Asia/Makassar",
"Asia/Novosibirsk",
"Asia/Pyongyang",
"Asia/Saigon",
"Asia/Singapore",
"Asia/Tel_Aviv",
"Asia/Ulaanbaatar",
"Asia/Yakutsk",
"Asia/Amman",
"Asia/Ashkhabad",
"Asia/Beirut",
"Asia/Chongqing",
"Asia/Dhaka",
"Asia/Harbin",
"Asia/Irkutsk",
"Asia/Kabul",
"Asia/Katmandu",
"Asia/Kuwait",
"Asia/Manila",
"Asia/Omsk",
"Asia/Qatar",
"Asia/Sakhalin",
"Asia/Taipei",
"Asia/Thimbu",
"Asia/Ulan_Bator",
"Asia/Yekaterinburg",
"Asia/Anadyr",
"Asia/Baghdad",
"Asia/Bishkek",
"Asia/Chungking",
"Asia/Dili",
"Asia/Hebron",
"Asia/Istanbul",
"Asia/Kamchatka",
"Asia/Kolkata",
"Asia/Macao",
"Asia/Muscat",
"Asia/Oral",
"Asia/Qyzylorda",
"Asia/Samarkand",
"Asia/Tashkent",
"Asia/Thimphu",
"Asia/Urumqi",
"Asia/Yerevan",
"Asia/Aqtau",
"Asia/Bahrain",
"Asia/Brunei",
"Asia/Colombo",
"Asia/Dubai",
"Asia/Ho_Chi_Minh",
"Asia/Jakarta",
"Asia/Karachi",
"Asia/Krasnoyarsk",
"Asia/Macau",
"Asia/Nicosia",
"Asia/Phnom_Penh",
"Asia/Rangoon",
"Asia/Seoul",
"Asia/Tbilisi",
"Asia/Tokyo",
"Asia/Vientiane",
"Australia/Canberra",
"Australia/LHI",
"Australia/NSW",
"Australia/Tasmania",
"Australia/Broken_Hill",
"Australia/Hobart",
"Australia/North",
"Australia/Sydney",
"Pacific/Chuuk",
"Pacific/Fiji",
"Pacific/Guam",
"Pacific/Kwajalein",
"Pacific/Niue",
"Pacific/Pitcairn",
"Pacific/Saipan",
"Pacific/Truk",
"Pacific/Chatham",
"Pacific/Fakaofo",
"Pacific/Guadalcanal",
"Pacific/Kosrae",
"Pacific/Nauru",
"Pacific/Palau",
"Pacific/Rarotonga",
"Pacific/Tongatapu",
"Pacific/Easter",
"Pacific/Funafuti",
"Pacific/Honolulu",
"Pacific/Majuro",
"Pacific/Norfolk",
"Pacific/Pohnpei",
"Pacific/Samoa",
"Pacific/Wake",
"Antarctica/Casey",
"Antarctica/McMurdo",
"Antarctica/Vostok",
"Antarctica/Davis",
"Antarctica/Palmer",
"Antarctica/DumontDUrville",
"Antarctica/Rothera",
"Antarctica/Macquarie",
"Antarctica/South_Pole",
"Antarctica/Mawson",
"Antarctica/Syowa",
"Arctic/Longyearbyen",
"Europe/Athens",
"Europe/Brussels",
"Europe/Dublin",
"Europe/Istanbul",
"Europe/Ljubljana",
"Europe/Mariehamn",
"Europe/Oslo",
"Europe/Rome",
"Europe/Skopje",
"Europe/Tiraspol",
"Europe/Vilnius",
"Europe/Zurich",
"Europe/Belfast",
"Europe/Bucharest",
"Europe/Gibraltar",
"Europe/Jersey",
"Europe/London",
"Europe/Minsk",
"Europe/Paris",
"Europe/Samara",
"Europe/Sofia",
"Europe/Uzhgorod",
"Europe/Volgograd",
"Europe/Belgrade",
"Europe/Budapest",
"Europe/Guernsey",
"Europe/Kaliningrad",
"Europe/Luxembourg",
"Europe/Monaco",
"Europe/Podgorica",
"Europe/San_Marino",
"Europe/Stockholm",
"Europe/Vaduz",
"Europe/Warsaw",
"Indian/Cocos",
"Indian/Mauritius",
"Indian/Christmas",
"Indian/Maldives",
"Indian/Comoro",
"Indian/Mayotte",
"Australia/Brisbane",
"Australia/Eucla",
"Australia/Melbourne",
"Australia/South",
"Australia/Yancowinna",
);
Timezones in PHP at http://www.php.net/manual/en/timezones.php
List of entire available timezones.
$time_zones = array (
0 => 'Africa/Abidjan',
1 => 'Africa/Accra',
2 => 'Africa/Addis_Ababa',
3 => 'Africa/Algiers',
4 => 'Africa/Asmara',
5 => 'Africa/Asmera',
6 => 'Africa/Bamako',
7 => 'Africa/Bangui',
8 => 'Africa/Banjul',
9 => 'Africa/Bissau',
10 => 'Africa/Blantyre',
11 => 'Africa/Brazzaville',
12 => 'Africa/Bujumbura',
13 => 'Africa/Cairo',
14 => 'Africa/Casablanca',
15 => 'Africa/Ceuta',
16 => 'Africa/Conakry',
17 => 'Africa/Dakar',
18 => 'Africa/Dar_es_Salaam',
19 => 'Africa/Djibouti',
20 => 'Africa/Douala',
21 => 'Africa/El_Aaiun',
22 => 'Africa/Freetown',
23 => 'Africa/Gaborone',
24 => 'Africa/Harare',
25 => 'Africa/Johannesburg',
26 => 'Africa/Juba',
27 => 'Africa/Kampala',
28 => 'Africa/Khartoum',
29 => 'Africa/Kigali',
30 => 'Africa/Kinshasa',
31 => 'Africa/Lagos',
32 => 'Africa/Libreville',
33 => 'Africa/Lome',
34 => 'Africa/Luanda',
35 => 'Africa/Lubumbashi',
36 => 'Africa/Lusaka',
37 => 'Africa/Malabo',
38 => 'Africa/Maputo',
39 => 'Africa/Maseru',
40 => 'Africa/Mbabane',
41 => 'Africa/Mogadishu',
42 => 'Africa/Monrovia',
43 => 'Africa/Nairobi',
44 => 'Africa/Ndjamena',
45 => 'Africa/Niamey',
46 => 'Africa/Nouakchott',
47 => 'Africa/Ouagadougou',
48 => 'Africa/Porto-Novo',
49 => 'Africa/Sao_Tome',
50 => 'Africa/Timbuktu',
51 => 'Africa/Tripoli',
52 => 'Africa/Tunis',
53 => 'Africa/Windhoek',
54 => 'America/Adak',
55 => 'America/Anchorage',
56 => 'America/Anguilla',
57 => 'America/Antigua',
58 => 'America/Araguaina',
59 => 'America/Argentina/Buenos_Aires',
60 => 'America/Argentina/Catamarca',
61 => 'America/Argentina/ComodRivadavia',
62 => 'America/Argentina/Cordoba',
63 => 'America/Argentina/Jujuy',
64 => 'America/Argentina/La_Rioja',
65 => 'America/Argentina/Mendoza',
66 => 'America/Argentina/Rio_Gallegos',
67 => 'America/Argentina/Salta',
68 => 'America/Argentina/San_Juan',
69 => 'America/Argentina/San_Luis',
70 => 'America/Argentina/Tucuman',
71 => 'America/Argentina/Ushuaia',
72 => 'America/Aruba',
73 => 'America/Asuncion',
74 => 'America/Atikokan',
75 => 'America/Atka',
76 => 'America/Bahia',
77 => 'America/Bahia_Banderas',
78 => 'America/Barbados',
79 => 'America/Belem',
80 => 'America/Belize',
81 => 'America/Blanc-Sablon',
82 => 'America/Boa_Vista',
83 => 'America/Bogota',
84 => 'America/Boise',
85 => 'America/Buenos_Aires',
86 => 'America/Cambridge_Bay',
87 => 'America/Campo_Grande',
88 => 'America/Cancun',
89 => 'America/Caracas',
90 => 'America/Catamarca',
91 => 'America/Cayenne',
92 => 'America/Cayman',
93 => 'America/Chicago',
94 => 'America/Chihuahua',
95 => 'America/Coral_Harbour',
96 => 'America/Cordoba',
97 => 'America/Costa_Rica',
98 => 'America/Creston',
99 => 'America/Cuiaba',
100 => 'America/Curacao',
101 => 'America/Danmarkshavn',
102 => 'America/Dawson',
103 => 'America/Dawson_Creek',
104 => 'America/Denver',
105 => 'America/Detroit',
106 => 'America/Dominica',
107 => 'America/Edmonton',
108 => 'America/Eirunepe',
109 => 'America/El_Salvador',
110 => 'America/Ensenada',
111 => 'America/Fort_Nelson',
112 => 'America/Fort_Wayne',
113 => 'America/Fortaleza',
114 => 'America/Glace_Bay',
115 => 'America/Godthab',
116 => 'America/Goose_Bay',
117 => 'America/Grand_Turk',
118 => 'America/Grenada',
119 => 'America/Guadeloupe',
120 => 'America/Guatemala',
121 => 'America/Guayaquil',
122 => 'America/Guyana',
123 => 'America/Halifax',
124 => 'America/Havana',
125 => 'America/Hermosillo',
126 => 'America/Indiana/Indianapolis',
127 => 'America/Indiana/Knox',
128 => 'America/Indiana/Marengo',
129 => 'America/Indiana/Petersburg',
130 => 'America/Indiana/Tell_City',
131 => 'America/Indiana/Vevay',
132 => 'America/Indiana/Vincennes',
133 => 'America/Indiana/Winamac',
134 => 'America/Indianapolis',
135 => 'America/Inuvik',
136 => 'America/Iqaluit',
137 => 'America/Jamaica',
138 => 'America/Jujuy',
139 => 'America/Juneau',
140 => 'America/Kentucky/Louisville',
141 => 'America/Kentucky/Monticello',
142 => 'America/Knox_IN',
143 => 'America/Kralendijk',
144 => 'America/La_Paz',
145 => 'America/Lima',
146 => 'America/Los_Angeles',
147 => 'America/Louisville',
148 => 'America/Lower_Princes',
149 => 'America/Maceio',
150 => 'America/Managua',
151 => 'America/Manaus',
152 => 'America/Marigot',
153 => 'America/Martinique',
154 => 'America/Matamoros',
155 => 'America/Mazatlan',
156 => 'America/Mendoza',
157 => 'America/Menominee',
158 => 'America/Merida',
159 => 'America/Metlakatla',
160 => 'America/Mexico_City',
161 => 'America/Miquelon',
162 => 'America/Moncton',
163 => 'America/Monterrey',
164 => 'America/Montevideo',
165 => 'America/Montreal',
166 => 'America/Montserrat',
167 => 'America/Nassau',
168 => 'America/New_York',
169 => 'America/Nipigon',
170 => 'America/Nome',
171 => 'America/Noronha',
172 => 'America/North_Dakota/Beulah',
173 => 'America/North_Dakota/Center',
174 => 'America/North_Dakota/New_Salem',
175 => 'America/Ojinaga',
176 => 'America/Panama',
177 => 'America/Pangnirtung',
178 => 'America/Paramaribo',
179 => 'America/Phoenix',
180 => 'America/Port-au-Prince',
181 => 'America/Port_of_Spain',
182 => 'America/Porto_Acre',
183 => 'America/Porto_Velho',
184 => 'America/Puerto_Rico',
185 => 'America/Rainy_River',
186 => 'America/Rankin_Inlet',
187 => 'America/Recife',
188 => 'America/Regina',
189 => 'America/Resolute',
190 => 'America/Rio_Branco',
191 => 'America/Rosario',
192 => 'America/Santa_Isabel',
193 => 'America/Santarem',
194 => 'America/Santiago',
195 => 'America/Santo_Domingo',
196 => 'America/Sao_Paulo',
197 => 'America/Scoresbysund',
198 => 'America/Shiprock',
199 => 'America/Sitka',
200 => 'America/St_Barthelemy',
201 => 'America/St_Johns',
202 => 'America/St_Kitts',
203 => 'America/St_Lucia',
204 => 'America/St_Thomas',
205 => 'America/St_Vincent',
206 => 'America/Swift_Current',
207 => 'America/Tegucigalpa',
208 => 'America/Thule',
209 => 'America/Thunder_Bay',
210 => 'America/Tijuana',
211 => 'America/Toronto',
212 => 'America/Tortola',
213 => 'America/Vancouver',
214 => 'America/Virgin',
215 => 'America/Whitehorse',
216 => 'America/Winnipeg',
217 => 'America/Yakutat',
218 => 'America/Yellowknife',
219 => 'Antarctica/Casey',
220 => 'Antarctica/Davis',
221 => 'Antarctica/DumontDUrville',
222 => 'Antarctica/Macquarie',
223 => 'Antarctica/Mawson',
224 => 'Antarctica/McMurdo',
225 => 'Antarctica/Palmer',
226 => 'Antarctica/Rothera',
227 => 'Antarctica/South_Pole',
228 => 'Antarctica/Syowa',
229 => 'Antarctica/Troll',
230 => 'Antarctica/Vostok',
231 => 'Arctic/Longyearbyen',
232 => 'Asia/Aden',
233 => 'Asia/Almaty',
234 => 'Asia/Amman',
235 => 'Asia/Anadyr',
236 => 'Asia/Aqtau',
237 => 'Asia/Aqtobe',
238 => 'Asia/Ashgabat',
239 => 'Asia/Ashkhabad',
240 => 'Asia/Baghdad',
241 => 'Asia/Bahrain',
242 => 'Asia/Baku',
243 => 'Asia/Bangkok',
244 => 'Asia/Beirut',
245 => 'Asia/Bishkek',
246 => 'Asia/Brunei',
247 => 'Asia/Calcutta',
248 => 'Asia/Chita',
249 => 'Asia/Choibalsan',
250 => 'Asia/Chongqing',
251 => 'Asia/Chungking',
252 => 'Asia/Colombo',
253 => 'Asia/Dacca',
254 => 'Asia/Damascus',
255 => 'Asia/Dhaka',
256 => 'Asia/Dili',
257 => 'Asia/Dubai',
258 => 'Asia/Dushanbe',
259 => 'Asia/Gaza',
260 => 'Asia/Harbin',
261 => 'Asia/Hebron',
262 => 'Asia/Ho_Chi_Minh',
263 => 'Asia/Hong_Kong',
264 => 'Asia/Hovd',
265 => 'Asia/Irkutsk',
266 => 'Asia/Istanbul',
267 => 'Asia/Jakarta',
268 => 'Asia/Jayapura',
269 => 'Asia/Jerusalem',
270 => 'Asia/Kabul',
271 => 'Asia/Kamchatka',
272 => 'Asia/Karachi',
273 => 'Asia/Kashgar',
274 => 'Asia/Kathmandu',
275 => 'Asia/Katmandu',
276 => 'Asia/Khandyga',
277 => 'Asia/Kolkata',
278 => 'Asia/Krasnoyarsk',
279 => 'Asia/Kuala_Lumpur',
280 => 'Asia/Kuching',
281 => 'Asia/Kuwait',
282 => 'Asia/Macao',
283 => 'Asia/Macau',
284 => 'Asia/Magadan',
285 => 'Asia/Makassar',
286 => 'Asia/Manila',
287 => 'Asia/Muscat',
288 => 'Asia/Nicosia',
289 => 'Asia/Novokuznetsk',
290 => 'Asia/Novosibirsk',
291 => 'Asia/Omsk',
292 => 'Asia/Oral',
293 => 'Asia/Phnom_Penh',
294 => 'Asia/Pontianak',
295 => 'Asia/Pyongyang',
296 => 'Asia/Qatar',
297 => 'Asia/Qyzylorda',
298 => 'Asia/Rangoon',
299 => 'Asia/Riyadh',
300 => 'Asia/Saigon',
301 => 'Asia/Sakhalin',
302 => 'Asia/Samarkand',
303 => 'Asia/Seoul',
304 => 'Asia/Shanghai',
305 => 'Asia/Singapore',
306 => 'Asia/Srednekolymsk',
307 => 'Asia/Taipei',
308 => 'Asia/Tashkent',
309 => 'Asia/Tbilisi',
310 => 'Asia/Tehran',
311 => 'Asia/Tel_Aviv',
312 => 'Asia/Thimbu',
313 => 'Asia/Thimphu',
314 => 'Asia/Tokyo',
315 => 'Asia/Ujung_Pandang',
316 => 'Asia/Ulaanbaatar',
317 => 'Asia/Ulan_Bator',
318 => 'Asia/Urumqi',
319 => 'Asia/Ust-Nera',
320 => 'Asia/Vientiane',
321 => 'Asia/Vladivostok',
322 => 'Asia/Yakutsk',
323 => 'Asia/Yekaterinburg',
324 => 'Asia/Yerevan',
325 => 'Atlantic/Azores',
326 => 'Atlantic/Bermuda',
327 => 'Atlantic/Canary',
328 => 'Atlantic/Cape_Verde',
329 => 'Atlantic/Faeroe',
330 => 'Atlantic/Faroe',
331 => 'Atlantic/Jan_Mayen',
332 => 'Atlantic/Madeira',
333 => 'Atlantic/Reykjavik',
334 => 'Atlantic/South_Georgia',
335 => 'Atlantic/St_Helena',
336 => 'Atlantic/Stanley',
337 => 'Australia/ACT',
338 => 'Australia/Adelaide',
339 => 'Australia/Brisbane',
340 => 'Australia/Broken_Hill',
341 => 'Australia/Canberra',
342 => 'Australia/Currie',
343 => 'Australia/Darwin',
344 => 'Australia/Eucla',
345 => 'Australia/Hobart',
346 => 'Australia/LHI',
347 => 'Australia/Lindeman',
348 => 'Australia/Lord_Howe',
349 => 'Australia/Melbourne',
350 => 'Australia/North',
351 => 'Australia/NSW',
352 => 'Australia/Perth',
353 => 'Australia/Queensland',
354 => 'Australia/South',
355 => 'Australia/Sydney',
356 => 'Australia/Tasmania',
357 => 'Australia/Victoria',
358 => 'Australia/West',
359 => 'Australia/Yancowinna',
360 => 'Europe/Amsterdam',
361 => 'Europe/Andorra',
362 => 'Europe/Athens',
363 => 'Europe/Belfast',
364 => 'Europe/Belgrade',
365 => 'Europe/Berlin',
366 => 'Europe/Bratislava',
367 => 'Europe/Brussels',
368 => 'Europe/Bucharest',
369 => 'Europe/Budapest',
370 => 'Europe/Busingen',
371 => 'Europe/Chisinau',
372 => 'Europe/Copenhagen',
373 => 'Europe/Dublin',
374 => 'Europe/Gibraltar',
375 => 'Europe/Guernsey',
376 => 'Europe/Helsinki',
377 => 'Europe/Isle_of_Man',
378 => 'Europe/Istanbul',
379 => 'Europe/Jersey',
380 => 'Europe/Kaliningrad',
381 => 'Europe/Kiev',
382 => 'Europe/Lisbon',
383 => 'Europe/Ljubljana',
384 => 'Europe/London',
385 => 'Europe/Luxembourg',
386 => 'Europe/Madrid',
387 => 'Europe/Malta',
388 => 'Europe/Mariehamn',
389 => 'Europe/Minsk',
390 => 'Europe/Monaco',
391 => 'Europe/Moscow',
392 => 'Europe/Nicosia',
393 => 'Europe/Oslo',
394 => 'Europe/Paris',
395 => 'Europe/Podgorica',
396 => 'Europe/Prague',
397 => 'Europe/Riga',
398 => 'Europe/Rome',
399 => 'Europe/Samara',
400 => 'Europe/San_Marino',
401 => 'Europe/Sarajevo',
402 => 'Europe/Simferopol',
403 => 'Europe/Skopje',
404 => 'Europe/Sofia',
405 => 'Europe/Stockholm',
406 => 'Europe/Tallinn',
407 => 'Europe/Tirane',
408 => 'Europe/Tiraspol',
409 => 'Europe/Uzhgorod',
410 => 'Europe/Vaduz',
411 => 'Europe/Vatican',
412 => 'Europe/Vienna',
413 => 'Europe/Vilnius',
414 => 'Europe/Volgograd',
415 => 'Europe/Warsaw',
416 => 'Europe/Zagreb',
417 => 'Europe/Zaporozhye',
418 => 'Europe/Zurich',
419 => 'Indian/Antananarivo',
420 => 'Indian/Chagos',
421 => 'Indian/Christmas',
422 => 'Indian/Cocos',
423 => 'Indian/Comoro',
424 => 'Indian/Kerguelen',
425 => 'Indian/Mahe',
426 => 'Indian/Maldives',
427 => 'Indian/Mauritius',
428 => 'Indian/Mayotte',
429 => 'Indian/Reunion',
430 => 'Pacific/Apia',
431 => 'Pacific/Auckland',
432 => 'Pacific/Bougainville',
433 => 'Pacific/Chatham',
434 => 'Pacific/Chuuk',
435 => 'Pacific/Easter',
436 => 'Pacific/Efate',
437 => 'Pacific/Enderbury',
438 => 'Pacific/Fakaofo',
439 => 'Pacific/Fiji',
440 => 'Pacific/Funafuti',
441 => 'Pacific/Galapagos',
442 => 'Pacific/Gambier',
443 => 'Pacific/Guadalcanal',
444 => 'Pacific/Guam',
445 => 'Pacific/Honolulu',
446 => 'Pacific/Johnston',
447 => 'Pacific/Kiritimati',
448 => 'Pacific/Kosrae',
449 => 'Pacific/Kwajalein',
450 => 'Pacific/Majuro',
451 => 'Pacific/Marquesas',
452 => 'Pacific/Midway',
453 => 'Pacific/Nauru',
454 => 'Pacific/Niue',
455 => 'Pacific/Norfolk',
456 => 'Pacific/Noumea',
457 => 'Pacific/Pago_Pago',
458 => 'Pacific/Palau',
459 => 'Pacific/Pitcairn',
460 => 'Pacific/Pohnpei',
461 => 'Pacific/Ponape',
462 => 'Pacific/Port_Moresby',
463 => 'Pacific/Rarotonga',
464 => 'Pacific/Saipan',
465 => 'Pacific/Samoa',
466 => 'Pacific/Tahiti',
467 => 'Pacific/Tarawa',
468 => 'Pacific/Tongatapu',
469 => 'Pacific/Truk',
470 => 'Pacific/Wake',
471 => 'Pacific/Wallis',
472 => 'Pacific/Yap',
473 => 'Brazil/Acre',
474 => 'Brazil/DeNoronha',
475 => 'Brazil/East',
476 => 'Brazil/West',
477 => 'Canada/Atlantic',
478 => 'Canada/Central',
479 => 'Canada/East-Saskatchewan',
480 => 'Canada/Eastern',
481 => 'Canada/Mountain',
482 => 'Canada/Newfoundland',
483 => 'Canada/Pacific',
484 => 'Canada/Saskatchewan',
485 => 'Canada/Yukon',
486 => 'CET',
487 => 'Chile/Continental',
488 => 'Chile/EasterIsland',
489 => 'CST6CDT',
490 => 'Cuba',
491 => 'EET',
492 => 'Egypt',
493 => 'Eire',
494 => 'EST',
495 => 'EST5EDT',
496 => 'Etc/GMT',
497 => 'Etc/GMT+0',
498 => 'Etc/GMT+1',
499 => 'Etc/GMT+10',
500 => 'Etc/GMT+11',
501 => 'Etc/GMT+12',
502 => 'Etc/GMT+2',
503 => 'Etc/GMT+3',
504 => 'Etc/GMT+4',
505 => 'Etc/GMT+5',
506 => 'Etc/GMT+6',
507 => 'Etc/GMT+7',
508 => 'Etc/GMT+8',
509 => 'Etc/GMT+9',
510 => 'Etc/GMT-0',
511 => 'Etc/GMT-1',
512 => 'Etc/GMT-10',
513 => 'Etc/GMT-11',
514 => 'Etc/GMT-12',
515 => 'Etc/GMT-13',
516 => 'Etc/GMT-14',
517 => 'Etc/GMT-2',
518 => 'Etc/GMT-3',
519 => 'Etc/GMT-4',
520 => 'Etc/GMT-5',
521 => 'Etc/GMT-6',
522 => 'Etc/GMT-7',
523 => 'Etc/GMT-8',
524 => 'Etc/GMT-9',
525 => 'Etc/GMT0',
526 => 'Etc/Greenwich',
527 => 'Etc/UCT',
528 => 'Etc/Universal',
529 => 'Etc/UTC',
530 => 'Etc/Zulu',
531 => 'Factory',
532 => 'GB',
533 => 'GB-Eire',
534 => 'GMT',
535 => 'GMT+0',
536 => 'GMT-0',
537 => 'GMT0',
538 => 'Greenwich',
539 => 'Hongkong',
540 => 'HST',
541 => 'Iceland',
542 => 'Iran',
543 => 'Israel',
544 => 'Jamaica',
545 => 'Japan',
546 => 'Kwajalein',
547 => 'Libya',
548 => 'MET',
549 => 'Mexico/BajaNorte',
550 => 'Mexico/BajaSur',
551 => 'Mexico/General',
552 => 'MST',
553 => 'MST7MDT',
554 => 'Navajo',
555 => 'NZ',
556 => 'NZ-CHAT',
557 => 'Poland',
558 => 'Portugal',
559 => 'PRC',
560 => 'PST8PDT',
561 => 'ROC',
562 => 'ROK',
563 => 'Singapore',
564 => 'Turkey',
565 => 'UCT',
566 => 'Universal',
567 => 'US/Alaska',
568 => 'US/Aleutian',
569 => 'US/Arizona',
570 => 'US/Central',
571 => 'US/East-Indiana',
572 => 'US/Eastern',
573 => 'US/Hawaii',
574 => 'US/Indiana-Starke',
575 => 'US/Michigan',
576 => 'US/Mountain',
577 => 'US/Pacific',
578 => 'US/Pacific-New',
579 => 'US/Samoa',
580 => 'UTC',
581 => 'W-SU',
582 => 'WET',
583 => 'Zulu',
)
Is 'UTC' a valid timezone identifier on your system?
<?php
if (date_default_timezone_set('UTC')){
echo "UTC is a valid time zone";
}else{
echo "The system doesn't know WTFUTC. Maybe try updating tzinfo with your package manager?";
}
In PHP DateTime (PHP >= 5.3)
$dt = new DateTime();
$dt->setTimezone(new DateTimeZone('UTC'));
echo $dt->getTimestamp();
You can always check this maintained list to timezones
https://www.php.net/manual/en/function.date.php