Jump to content

Search String


laPistola

Recommended Posts

Right i making an info panel for a website that returns useful information to the client for when they are speaking to PC teckys on the phone and one of the bits of info is there ISP

 

As

gethostbyaddr($_SERVER['REMOTE_ADDR'])

returns a horrbile long string of text the user wouldn't really understand and telling the tecky each letter of the string will take time i thought it would benfit if it just said the ISP name, so i have asked longs of people to send me the results of gethostbyaddr($_SERVER['REMOTE_ADDR']) on there computer and which ISP there with.

 

Anyway, all im after is the correct function to use to do a basic search on a string, i have looked at preg_match() and strstr() but dont think they are the correct ones to use.

 

this is what the script will be like

 

<?php
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
if (search here for ntl) {
echo 'Virgin Media (NTL)';
} else if (search of sky) {
echo 'Sky';
} else if (search for bt) {
echo 'BT';
} and so on
?>

does anyone know of the fastest simplest function to do that kinda search

Thank you

Link to comment
https://forums.phpfreaks.com/topic/139089-search-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.