I'm stumbling at the first hurdle here, wondering if anyone can give me a hint?
I'm trying to test for the presence of "http://" in a string then return one of two variables.
Code: Select all
<?php
$url = "http://www.domain.co.uk";
$link1 = "<a href=\"";
$link2 = "<a href=\"http://";
if ( $url == "^(http://).*" )
{
$version = $link1;
}
elseif ( $url != "^(http://).*" )
{
$version = $link2;
}
echo $version,$url,"\">$url</a><br>";
?>Any help much appreciated
daveW