<?php
$string = 'www.google.com';//string
$ss = strpos($string,'http://');//cheking whether the part of string exist in full string or not
if($ss!==false)//if exists
{
$string = $string;
}
else
{
$string = 'http://'.$string;
}
echo $string;//final string.
?>
$string = 'www.google.com';//string
$ss = strpos($string,'http://');//cheking whether the part of string exist in full string or not
if($ss!==false)//if exists
{
$string = $string;
}
else
{
$string = 'http://'.$string;
}
echo $string;//final string.
?>
No comments:
Post a Comment