I have custom tags [tag val=100][/tag]. How do I get val and whatever goes between the tags?
ex:
[tag val=100]apple[/tag]
value1 = 100
value2 = apple
edit: what if I had multiple items inside the tag
ex:
[tag val=100 id=3]
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.
If you have a string like that in your question, you can use
preg_matchinstead ofpreg_match_all:Update: I see you might have multiple attributes in each element. In that case, this should work: