parsing - PHP Get a part from $string -
could pls me parse string?
the string is:
$str = 'http://test.al/admin/?plugin=pages&act=delete&file=test-page';
it's dynamic , contain more &-symbols.
i want part starting "&..." result should :
http://boot.al/admin/?plugin=pages
need go after deleting file, clear additional $_get params.
thank in advance!
use strtok()
:
<?php $str = 'http://test.al/admin/?plugin=pages&act=delete&file=test-page'; $result = strtok($str, '&'); var_dump($result); // outputs "http://test.al/admin/?plugin=pages"
Comments
Post a Comment