Re: Getting the Leftmost 7 Characters of String

From: Date: Wed, 28 Jun 2000 20:10:28 +0000
Subject: Re: Getting the Leftmost 7 Characters of String
Groups: php.general 
Request: Send a blank email to php-general+get-3654@lists.php.net to get a copy of this message
substr($string, $start, $length); substr("Hello World", 0, 5); // outputs "Hello" In your case, a regexp will be necessary because you do not know exactly the number of characters in a class C: Notice the different lengths: 111.111.111.111 11.11.11.11 1.1.1.1 I see someone just posted on the list with the proper regex to do it. I think it's probably the best way. -- Matthew Leverton - matthew@aeroinc.net - http://www.allegro.cc -----Original Message----- From: Graham Pearson <gpearson@support.niesc.k12.in.us> To: php-general@lists.php.net <php-general@lists.php.net> Date: Wednesday, June 28, 2000 3:01 PM Subject: [PHP] Getting the Leftmost 7 Characters of String >Group: > >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. > >I am able to do this via ColdFusion but yet in PHP. Any Ideas or directions >to look at. > >-- >Get Paid to Surf the Net -- The Rules have changed >Http://www.alladvantage.com/home.asp?refid=EOW694 > >================================================================ >Graham Pearson, Technology Support Center Supervisor >Northern Indiana Educational Services Center >Http://support.niesc.k12.in.us Voice (219) 254-0111 Fax: (219) 254-0148 > >Email: gpearson@support.niesc.k12.in.us > > >-- >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 >

« previous php.general (#3654) next »