$pieces = explode('/', $_GET['q']);
where
- $pieces is the variable where the url is splitted and stored as an array.
- $_GET['q'] will contain the url address
- Values will be splited against '/'
- $pieces[1] will contains the first parameter after splitting
- for eg. if $abc='India-Wins'
- $xyz = explode('-', $abc); // the variable is splitted against '-' (hipen)
- now $xyz[0]='India' and $xyz[1]='Wins'
No comments:
Post a Comment