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

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -