Re: Parse a url for a specific string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello web_singer,

Tuesday, November 30, 2004, 11:57:33 AM, you wrote:

w> I would like to parse a url which is submitted to me for a link to
w> check if it already has a link to my site on it. Does anyone know
w> if php has a function which would allow me to do this relatively
w> easily?

You could use a regular expression, but strpos will work just as well:

$my_url = 'www.blah.com';
$test = strpos($their_url, $my_url);
if ($test === false)
{
   echo 'No link';
}
else
{
   echo 'Link is in there somewhere';
}

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux