regex - Reqular expred in php -


this question has answer here:

i need small part of helping, can't remember requlare exp. tell me url or not, need tjeck starting whit http:// or not, befures if not have http:// in start need put , if have need nothing.

hobe sombardy can me whit queistion, , lot helping.

template 1:

<a href="http://myurl.com">title 1</a> 

template 2:

<a href="www.myurl2.com">title 2</a> 

use preg_replace this

$url = 'http://www.yahoo.com'; echo 'http://' . preg_replace( '~^http://~', '', $url ); 

Comments