Re: Adding "a" in "try.jpg"!
| From: | Jason Wong | Date: | Mon, 08 Apr 2002 07:45:59 +0000 |
| Subject: | Re: Adding "a" in "try.jpg"! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91998@lists.php.net to get a copy of this message | ||
On Monday 08 April 2002 15:41, Thomas Edison Jr. wrote:
> How can i :
> 1. Insert "a" at the end of the name of the image,
> before the ".extension" through PHP.
> The problems are that the names are stored in the
> database WITH the extesion. And the extensions also
> vary, some are JPG and some are GIF. So in my datase i
> have images as "try.jpg" or "something.gif"! How can i
> insert an "a" at the end of the name before the "." ?
>
> 2. OR.. can i insert the "a" before the "." in the
> image name in my mySQL database itself.
Loads of ways to do it. Here's one:
explode() the file name on "." then concatenate an "a" onto the second from
last element, then implode().
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Don't worry. Life's too long.
-- Vincent Sardi, Jr.
*/