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
Post a Comment