Re: substr?

From: Date: Thu, 19 Jun 2008 18:02:51 +0000
Subject: Re: substr?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-275636@lists.php.net to get a copy of this message
Know what I found that works most reliably though? $filenameExploded = explode(".", $filename); that way, if I have a file like this: filename.todaysdate.todaystime.extension I don't end up with the extension being: .todaysdate.todaystime.extension :) Unless I was using the substr() command wrong. On Jun 19, 2008, at 1:53 PM, Philip Thompson wrote:
Does that get a different result than mine? ~Phil On Jun 19, 2008, at 10:44 AM, Daniel Brown wrote:
Try this: <?php $filename = 'this_example.php.file.backup.phps'; echo substr($filename,(strrpos($filename,'.') + 1),strlen($filename))."\n"; ?>
--PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 11287 James St Holland, MI 49424 www.raoset.com japruim@raoset.com

« previous php.general (#275636) next »