Postingan Yang Kamu Cari

Sabtu, 27 Maret 2010


Code Snippet: Make sure a url starts with http://

by John Email
if( strpos($url, 'http://') === false )
$url = 'http://' . $url;
Or if you are a fan of single line functions
$url = ( strpos($url, 'http://') === false ) ? 'http://' . $url : $url;

Tidak ada komentar: