Re: Getting the Leftmost 7 Characters of String

From: Date: Wed, 28 Jun 2000 20:06:27 +0000
Subject: Re: Getting the Leftmost 7 Characters of String
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3651@lists.php.net to get a copy of this message
I have been trying to acquire via php the class c address of a specific $REMOTE_ADDR variable. I have a series of webpages that need to be viewed only from remote clients that are on the local lan and if a client views the specific pages from outside the lan, redirect them to another webpage.
Someone else may have a better way, but I'm inclined to go with a regexp, such as ereg("([0-9]+\.[0-9]+\.[0-9]+)\.[0-9]+", $str, $results) Shawn

« previous php.general (#3651) next »