3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); $array[0] = 'Los%20Angeles,%20CA,%20United%20States%20(LAX-Los%20Angeles%20Intl.)'; $array[1] = "Miami,%20FL,%20United%20States%20(MIA-Miami%20Intl.)"; $array[2] = "Nassau,%20Bahamas%20(NAS-Nassau%20Intl.)"; $array[3] = "Honolulu,%20HI,%20United%20States%20(HNL-Honolulu%20Intl.)"; $array[4] = "Mexico%20City,%20Distrito%20Federal,%20Mexico%20(MEX-Mexico%20City%20Intl.)"; $array[5] = "George%20Town,%20Cayman%20Islands%20(GCM-Owen%20Roberts%20Intl.)"; if ( $_SESSION['pack'] == "FL PACKAGE - 3DAY" ) { $dest = $array[1]; $exp = explode('- ', $_SESSION['pack']); $pack_days = str_replace('DAY', '', $exp); } //JAN - 1 //FEB - 2 //MAR - 3 //APR - 4 //MAY - 5 //JUN - 6 //JUL - 7 //AUG - 8 //SEP - 9 //OCT - 10 //NOV - 11 //DEC - 12 $explode = explode('/', $_POST['date_dep']); $day = $explode[1] + $pack_days; $month = $explode[0]; $year = $explode[2]; if ( ($explode[0] == 1 OR $explode[0] == 3 OR $explode[0] == 5 OR $explode[0] == 7 OR $explode[0] == 8 OR $explode[0] == 10 OR $explode[0] == 12) && $day > 31 ) { $day -= 31; $month += 1; } if ( ($explode[0] == 4 OR $explode[0] == 6 OR $explode[0] == 9 OR $explode[0] == 11) && $day > 30 ) { $day -= 30; $month += 1; } if ( $explode[0] == 2 && $day > 28 ) { $day -= 28; $month += 1; } if ( $month == 13 ) { $month -= 12; $year += 1; } $date = $month.'/'.$day.'/'.$year; $from = "from:FLL"; //leg1 $from2 = ",to:".$dest; //leg1.2 $datefrom = ",departure:".$_POST['date_dep']."TANYT"; //leg1.3 $to = "from:".$dest; //leg2 $to2 = ",to:FLL"; //leg2.1 $dateto = ",departure:".$date."TANYT"; //leg 2.3 $children_ages = array(); $num = $_POST['children']; if ( $num == 0 ) { $children_imp = null; } else { for ($i = 0; $i <= $num - 2; $i++) { $children_ages[] = '15;'; } $children_ages[$i] = '15'; $children_imp = '['.implode($children_ages).']'; } $children = "children:".$_POST['children'].$children_imp; $adults = ",adults:".$_POST['adults']; $seniors = ",seniors:0"; $infant_in = ",infantinlap:Y"; $url_formatted = "http://www.travelocity.com/Flights-Search?trip=roundtrip&leg1=".$from.$from2.$datefrom."&leg2=".$to.$to2.$dateto."&passengers=".$children.$adults.$seniors.$infant_in."&mode=search"; header('Location: '.$url_formatted);

preferences:
115.26 ms | 402 KiB | 5 Q