Search
 
SCRIPT & CODE EXAMPLE
 

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];

?>
Comment

PREVIOUS NEXT
Code Example
Php :: get count sql query in php 
Php :: wp show logo 
Php :: How to change add to cart button in wordpress 
Php :: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes 
Php :: reload page in php 
Php :: Wordpress hook for newly published post 
Php :: php put file in ftp server 
Php :: yii2 redirect back 
Php :: how to print array in laravel blade 
Php :: php read xml from url 
Php :: laravel eloquent merge request 
Php :: how to get the link of the current page in php 
Php :: display exception in blade laravel 
Php :: laravel env google smtp 
Php :: delete property from object php 
Php :: switch in laravel 
Php :: wp_mail html content 
Php :: php escape special characters 
Php :: Print exact sql statement executed 
Php :: laravel plural 
Php :: save error cakephp 2 
Php :: include a page from another directory php 
Php :: how make exception laravel if operation does not work 
Php :: laravel gmail 
Php :: link input button in php 
Php :: php replace method that takes infinite input 
Php :: php json_decode 
Php :: how change the languge of fie manager in laravel 
Php :: how to hide get parameters in url php 
Php :: magento 2 get collection 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =