Answers for "explode url in php"

PHP
0

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

?>
Posted by: Guest on October-29-2020
1

explode in php

<?php
$str = "Hello world. It's a beautiful day.";
$split = explode(" ",$str);
$hello = $split[0];
$world = $split[1];
?>
Posted by: Guest on August-13-2021

Browse Popular Code Answers by Language