Re: Comparing strings... need advice. :)

From: Date: Mon, 28 Aug 2006 08:53:51 +0000
Subject: Re: Comparing strings... need advice. :)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-241155@lists.php.net to get a copy of this message
Stut wrote:
First of all make sure you are sending both strings through realpath (http://php.net/realpath) to remove any symbolic links and relative references. Then you can compare the two strings. The way you're doing it will work but it's probably not very efficient. This is what I use... $valid = (strcmp($needle, substr($haystack, 0, strlen($needle))) == 0);
Awsome! Thanks for the info. Reading-up on realpath right now. I appreciate the tips/example code. :) Have a great day/night. Cheers, Micky

« previous php.general (#241155) next »