Hi there,
Suppose I have a text like this:
$a="Hi there, suppose [I have:a text] like this, [can:you] help me?";
Now I would like to have an array consisting of:
$b[0] : "Hi there, suppose ";
$b[1] : "~I have";
$b[2] : "~~a text";
$b[3] : " like this, ";
$b[4] : "~can";
$b[5] : "~~you";
$b[6] : " help me?";
Where the ~ help me find which elements were found between the square brackets.
I tried preg_split, but what would the pattern look like?
Thanks,
Elck
Suppose I have a text like this:
$a="Hi there, suppose [I have:a text] like this, [can:you] help me?";
Now I would like to have an array consisting of:
$b[0] : "Hi there, suppose ";
$b[1] : "~I have";
$b[2] : "~~a text";
$b[3] : " like this, ";
$b[4] : "~can";
$b[5] : "~~you";
$b[6] : " help me?";
Where the ~ help me find which elements were found between the square brackets.
I tried preg_split, but what would the pattern look like?
Thanks,
Elck