Skip to content
Advertisement

Capturing text between two groups of square brackets in PHP

I need some way of capturing the text between two group of square brackets. So for example, the following string:

JavaScript

I need to output “bar”, but ‘bar’ is a variable word

How can I get the output I need?

Advertisement

Answer

Maybe with this simply expression:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement