Return to Snippet

Revision: 52294
at October 19, 2011 14:29 by focal55


Initial Code
<?php
$url = "blahblah.com";
// to clarify, this shouldn't be === false, but rather !== 0
if (0 !== strpos($url, 'http://') && 0 !== strpos($url, 'https://')) {
   $url = "http://{$url}";
}
?>

Initial URL


Initial Description


Initial Title
PHP link href formatter

Initial Tags
url, php, format

Initial Language
PHP