I ve to search the / (slash ) from the end in this url address: http://localhost/Projects/admin/uploadlist.php and change it to http://localhost/Projects/admin/resized/uploadlist.php , so first need to find the / and then add resized/ to it , can any one help me?
i ve found this but not helping me ;
$url= 'http://localhost/Projects/admin/uploadlist.php ';
$newurl= strstr($url, '/');
search the sign from end of a string
Moderator: General Moderators
Re: search the sign from end of a string
The simplest way str_replace('/admin','/admin/resized/',$url);
ugly but it will work if that only the problem
ugly but it will work if that only the problem
Re: search the sign from end of a string
thx a lot , this one works, but what if i want to search the / from the end of this url like
http://localhost/Projects/admin/uploadlist.php and then change it to http://localhost/Projects/admin/resized/uploadlist.php , meaning search last / and add "resized/" after it
http://localhost/Projects/admin/uploadlist.php and then change it to http://localhost/Projects/admin/resized/uploadlist.php , meaning search last / and add "resized/" after it