I have this tag on an HTML code:
text html [button link="google.com" color="#fff" text="this text here"] rest of html
I wish i could have the parameters of this "button code" in a PHP variable, but have no idea how because of Regex.
I tried using preg_match_all but no success. Like this one:
preg_match_all('/color=(w*)/i', $text, $color);
Thanks!
2
Answers
Thanks guys. I will post the result that worked for me. Maybe it helps someone else! The options are already in my language, portuguese. But you can understand!
I needed the script to solve the codes for more than one tag in the same HTML.
You could use preg_match_all():
Output: