Re: filename into variable.

From: Date: Wed, 04 Apr 2001 18:32:08 +0000
Subject: Re: filename into variable.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47117@lists.php.net to get a copy of this message
Something like this would work ... let's say your path is http://www.server.com/images/screenshot_1.php <? $junk = explode('/',$REQUEST_URI); list(,,$file) = $junk; list($picture) = explode('.',$file); ?> That should do it just fine .... I might be off on my commas On Wed, Apr 04, 2001 at 01:26:27PM -0500, Michael Roark wrote: > How would i go about building a page which could use the name of the page > less .php as a variable. > For example: > > Say I have a file called screenshot_1.php and another called > screenshot_2.php . Inside each of those files I want to have code which > will take the name of the file from the url and assign that value to a > variable. So $picture would get the value screenshot_1 from > screenshot_1.php and so on. > > > > > Michael Roark > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/

« previous php.general (#47117) next »