seran128 Posted November 28, 2006 Share Posted November 28, 2006 I have a table that holds the path to a filehome/myname/public_html/site1/Images/bbd61948840809e5a0d83b3cf21bdd47.pngWhat I want to do is cut the home/myname/public_html/site1/Images/My code that gets the results is <td colspan="2" class="Results" ><img src="<? echo $info[0]['ImagePath1'] ?>"></td>and this returnsa broken image and the properties of that image ishttp://mydomain.com/home/myname/public_html/site1/Images/bbd61948840809e5a0d83b3cf21bdd47.png Link to comment https://forums.phpfreaks.com/topic/28765-removing-characters-from-a-string/ Share on other sites More sharing options...
Orio Posted November 28, 2006 Share Posted November 28, 2006 If it's the same all the time (the part you want to remove) you can do something like this:[code]<?php//$path holds the full path (IE "home/myname....fhed.png")$len = strlen("home/myname/public_html/site1/Images/");$file_name=substr($path,$len);echo $file_name;?>[/code]Orio. Link to comment https://forums.phpfreaks.com/topic/28765-removing-characters-from-a-string/#findComment-131683 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.