I have this image in my database: http://thumbs.forrent.com/imgs/fr/prope ... 000020.jpg
And in my database I have this URL for the image.
Well, where the PHP comes in, to show the image I am taking the subtring of the image of the first 25 characters.
My code is: $subImage = substr($image,0,25) where $image is the URL given...
I want to be getting: "http://thumbs.forrent.com"
But I am getting just a number 1.
Any help would be great...
Substring Question...
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Substring Question...
Dunno why you're getting 1. echo $image and make sure it's what you think it is. Also, check out parse_url().
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Substring Question...
I got it now. It was doing it right in the first place.
When I printed the subImage in a if-statement, it would return 1. If I printed the subImage outside of the statement, it would return the desired result.
When I printed the subImage in a if-statement, it would return 1. If I printed the subImage outside of the statement, it would return the desired result.