PHP split() function - Regular Expression "Reversal&quo
Posted: Tue Jan 18, 2005 7:44 am
Hello everone. I have a little snippit of code here that does the opposite of what I need it to do and was hoping someone could offer some help.
Suppose you have the following text:
This information is stored as a string in a variable in my php script. And I am using the following code:
When printing the contend of $isolatedData, the following appears:
Basically, what I am trying to do is figure out the "opposite" of that to get the following:
I tried using the ereg function with the final array parameter in this fashion:
However, this only gives me back [random] andrandom,
Can anyone help out?
Thanks.
Suppose you have the following text:
Code: Select all
I am some їrandom] text. This is їsomething.something] that їbla] and їbla:bla].Code: Select all
$isolatedData = split("\\ї(її:print:]]+)\\]", $contents);Code: Select all
I am some
text. This is
that
andCode: Select all
їrandom]
їsomething.something]
їbla]
їbla:bla]Code: Select all
ereg("\\ї(її:print:]]+)\\]", $contents, $isolatedData);Can anyone help out?
Thanks.