Jump to content

Trim Value


seran128

Recommended Posts

$test="/home/jeffnort/public_html/site1/GarageSaleImages/de126f931451872c80680e72ca3ac4df.png";
$test=substring($test,1);#This will removes the first "/" in the string.
$testarr=explode("/",$test);#Forming an array with the breaking character "/".
$testarr=arrreverse($testarr)# This will reverse the array .

$final_string=.'/'.$testarr[0].'/'.$testarr[1]; #this will form the fianl strign with last two fields of the array.

Regards
Joshi.

Link to comment
https://forums.phpfreaks.com/topic/28755-trim-value/#findComment-131992
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.