RE: [PHP] Getting the Leftmost 7 Characters of String
| From: | Jason | Date: | Wed, 28 Jun 2000 20:10:01 +0000 |
| Subject: | RE: [PHP] Getting the Leftmost 7 Characters of String | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3653@lists.php.net to get a copy of this message | ||
Check out the string functions. Especially the 'substr()' function.
http://us.php.net/manual/function.substr.php
http://us.php.net/manual/function.strrchr.php
Basically you'll want to do something like this to get the class C IP.
$class_c = substr($ip_address,0,strrchr($ip_address,"."));
This will find the last "." and give you everything before it.
Jason
> -----Original Message-----
> From: Graham Pearson [mailto:gpearson@support.niesc.k12.in.us]
> Sent: Wednesday, June 28, 2000 2:07 PM
> To: php-general@lists.php.net
> 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
>
>
_______________________________________________________
Site Design, Hosting, and E-Commerce at www.webpipe.net