Re: Strings

From: Date: Tue, 12 Dec 2000 00:12:35 +0000
Subject: Re: Strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29774@lists.php.net to get a copy of this message
BO> I have a variable that uses "/" to separate words, and I want to take the BO> last word of the string of and return everything before it. Here are some BO> examples: BO> /usr/test/because ==> /usr/test/ /this/is/a/test ==>> /this/is/a/ BO> is there an easy way to take everything past the last "/" off (the string BO> changes so there will be different numbers of "/" and I only want the last BO> word off.)?? The first idea I get is to use strrchr() in conjunction with substr()... have a look at those 2 function under "String functions" in the manual. Cheers, Gianluca -- ALBASOFTWARE C/ Mallorca 186 - 3º 1ª 08036 Barcelona (Spain) Tel. +34 93454009 - +34 934549324 Fax. +34 934541979 @@ ICQ 47323154 @@ webmaster@albasoftware.com http://www.albasoftware.com http://www.phpauction.org http://www.gianlucabaldo.com

« previous php.general (#29774) next »