Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to split url in php

<?php
$url = 'http://www.example.com/news?q=string&f=true&id=1233&sort=true';

$values = parse_url($url);

$host = explode('.',$values['host']);

echo $host[1];

?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #url #php
ADD COMMENT
Topic
Name
7+7 =