php - cut array from a specific character -



php - cut array from a specific character -

i have in $array[0]:

attack-responses.rules?rev=1.35&content-type=text/vnd.viewcvs-markup

i want have in $array[0]

attack-responses.rules

i mean when see '?' must cutting it.

is there php function?

parse_url()

$array[0] = parse_url($array[0], php_url_path);

or list()/explode()

list($array[0]) = explode('?', $array[0], 2);

or substr()/strpos()

$array[0] = substr($array[0], 0, strpos($array[0], '?'))

php arrays multidimensional-array

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -