I'd like to string matching with regular expression by using preg_match() This is my code
$string = preg_match("/http\:\/\//","http");
Use $matches another parameter inside the preg_match function. Like this
<?php preg_match("/http\:\/\//","http://",$matches); // this $matches echo out as a array object then, print_r($matches); ?>
I hope this will work.