Sometimes the programmer need to identify the link contains http or https. Using php code can do this easily.
First store the string to a php varible- $URLstring=”https://smarttips.in/smarttips_logo.jpg”;
Second use the substr() function to find the occurrence of http or https -substr($URLstring, 0, 7)
<?php
$fromUrl =’0′;
$URLstring=”https://smarttips.in/smarttips_logo.jpg”;
if(substr($URLstring, 0, 7) == “http://”) { $fromUrl = “http”;
}
else if(substr($URLstring, 0, 8) == “https://”) {
$fromUrl = “https”;
}
?>
from the above code the $fromUrl variable returns the result.