Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get url segment in php

$uri_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uri_segments = explode('/', $uri_path);

echo $uri_segments[0]; // for www.example.com/user/account you will get 'user'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #url #segment #php
ADD COMMENT
Topic
Name
1+2 =