That is my preg_match code:
if (strlen($str) > 0)
if (!preg_match('/(http:\/\/www.vbox7.com[^\"]*)/', $str))
return false;
return true;
$str = 'http://vbox7.com/play:5ee7f7f6bf';
but why always return false?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First off, the your regex will not detect your URL, because it explicitly looks for the “www” string. Alternately, you can try:
Also, you might want to set your $str at the top, instead of the bottom.