Hi 😃 I have a string returned from a db field that I search for "[url=". If it is found I want to change the contents into a html link. The full string I need to get is formatted as below. "[url="."address.com]"."link text"."[/url]" //i had to break it up to stop this forum changing it to a link I can find the strpos of the first '[' and of the final ']' I want to extract two variables $address and $link_text for the str_replace, and i think i will need to get the length from the first '[' to the final ']', so i can replace it all in one go rather than bit by bit. I'm a bit out of my depth. I think i need to count from the '' and then grab the address, but i dont know the functions to use or how to structure the for loop that will count the length of the address... I would appreciate your input.
What you probably need are Regular Expressions (e.g. the preg_split() function) as they allow you to pull a string apart and work with each bit that you extract