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

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -