3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function r($str) { $str=explode('/', $str); var_dump( $str); $str=explode('.htm?', $str[2]); $str=explode('-', $str[0]); $str=$str[count($str)-1]; echo $str; } r("/kayak/es/husa-ciudad-de-compostela-60337.htm?checkin=2014-05-01&checkout=2014-05-02");
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(4) { [0]=> string(0) "" [1]=> string(5) "kayak" [2]=> string(2) "es" [3]=> string(74) "husa-ciudad-de-compostela-60337.htm?checkin=2014-05-01&checkout=2014-05-02" } es