hi guys, i am trying to create a button that when u press if in the text are will appear … i know this is js do don’t worry i will manage to do it, my problem is in php, i did a function that recognizes the link between … and then it embades it and shows me a youtube video instead, the problem i got is that if i have in the text area more …, like: bla bla balyoutube link and the other vid youtube link i dont know how to make it embade both, i dont know how to check if there is more, and the second problem i got is that all the text that was not betwen … will disapear after the vide is embadded, here is the code i done until now [code]
Hi,
looks like you’re reading the output of the regex wrong. You want the array to return all occurrences of (THIS!), right?
But you’re getting one time match of the whole pattern.
If you do the following:
[php]
$allLinks = $output[1];
[/php]
you can step through the resultlist of of just the part between parentheses. ( it’s in $allLinks ).
For a more elaborate description of how preg_match_all() works, http://php.net/manual/en/function.preg-match-all.php 8)
I hope this helps.
Good luck.
O.