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 php tutorial on WordPress.com
categories
Calendar
September 2017
M T W T F S S
« Aug    
 123
45678910
11121314151617
18192021222324
252627282930  
Follow me on Twitter
Blog Stats
  • 75,483 hits