Ryan S wrote:
> Hey Todd, Eric,
>
> Thanks for replying.
>
>> I don't believe you need both the / and the # for delimiters in your
>> RegEx. Try using just # (since / is actually going to be in the text
>> you're searching for) like this:
>>
>> <?php
>> $data =
>> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg");
>> preg_match('#<title>([^<]*)</title>#iU', $data, $match);
>> $title = $match[1];
>> echo $title;
>> ?>
>>
>>
>
>> You can also escape the / like \/.
>
>
> Ok, I changed it to:
> <?php
> $data = file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg");
> preg_match('/#<title>([^<]*)<\/title>#iU',$data,$match);
> $title=$match[1];
> echo $title;
> ?>
> And this is the error i am getting:
>
> Warning: preg_match() [function.preg-match]: No ending delimiter '/' found
> in C:\wamp\www\ezee\tests\get_remote_title.php on line 3
>
>
>
>
>
Take off the first /
preg_match('#<title>([^<]*)<\/title>#iU',$data,$match);
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php