• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Grab text between tags in PHP

phaxmohdem

Golden Member
Hey all.

I've got a quick php question thats stumped me after a lot of google research. I need to be able to grab the text between two set tags:

Ex.
[tag] URL_Goes_here [/tag]

So I'd need to save "URL_Goes_here" to a variable $var

the tricky part is this will be in the middle of random text, so the script will need to search through the whole variable containing the text

Scan through $full_text
Look for [tag]
Grab everything between [tag] and [/tag]
Save findings to var $var

Any tips on doing this?

Thanks
 
Back
Top