html - Using link data as PHP variable input -
i have link. eg. abc.com/qwerty. want extract part after / of every input examples below , use php input value , store variable $page. essentially, link abc.com/qwerty should work abc.com/proc.php?x=qwerty
typed link part used php input abc.com/cvbx cvbx abc.com/ghvs ghvx abc.com/pabc pabc how can this?
you can use: $_server['request_uri']
$request_uri = $_server['request_uri']; //returns '/cvbx' $segments = array_filter(explode('/', $request_uri)); //array_filter remove empty elements.
Comments
Post a Comment