Preg_Match data outside of square brackets
I have a string from MySQL and I want to get the data outside the square
brackets.
Here are my data:
[USERNAME] User [OS INFO] Microsoft Windows NT 6.1.7601 Service Pack 1
[MACHINE NAME] MACHINE-2[LANGUAGE_INFORMATION] 4.0.30319.1
How to get this:
Microsoft Windows NT 6.1.7601 Service Pack 1
Tried by this:
preg_match_all("/].*?\[/", $adat["INFORMATION"], $result_array);
After this I get:
print_r( $result_array[0][1] );
] Microsoft Windows NT 6.1.7601 Service Pack 1 [
How to get the data without the brackets?
No comments:
Post a Comment