Blog Archives

extract or get first string from current url in php


$url =”$_SERVER[‘REQUEST_URI’]”; or $url=”https://ephptutorial.wordpress.com/category/internal-messaging-system-in-codeigniter/”; $path = $url); $newpath = $path[‘path’]; $new = explode(‘/’,$newpath); echo $new[2];// Result: category Advertisements

Tagged with: , , , , , , ,
Posted in extract or get first string from current url in php
Follow Tutorial on WordPress.com
categories
Calendar
May 2018
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  
Follow me on Twitter
Blog Stats
  • 78,424 hits