how to split url in php

Solutions on MaxInterview for how to split url in php by the best coders in the world

showing results for - "how to split url in php"
Caterina
30 Oct 2019
1<?php
2$url = 'http://www.example.com/news?q=string&f=true&id=1233&sort=true';
3
4$values = parse_url($url);
5
6$host = explode('.',$values['host']);
7
8echo $host[1];
9
10?>
11