String
$str = ' [Ol5febykjdwcdtrjzauf] 1 @ 2012-06-19 20:46:44 ';
I want to get
[] content within the []
] and the content between @
What's behind @
How to write a regular expression ...
School's all back to the teacher.
Reply to discussion (solution)
Print_r (Preg_split ('/[\[\]@]/', $str,-1, preg_split_no_empty));
Print_r (Preg_split ('/[\[\]@]/', $str,-1, preg_split_no_empty));
I now write Preg_match ("/\[(. *?)" \] (.*?) @ (\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})/", $str, $m);
The result of the match is
$m =array ([0] = [Ol5febykjdwcdtrjzauf] 1 @ 2012-06-19 20:46:44 [1] = = Ol5febykjdwcdtrjzauf [2] = 1 [3] = 2 012-06-19 20:46:44)
How to modify the regular to get rid of the first item in the current result ($m [0])
You can use the Array_shift () function to delete the first element if you do not have the correct one.
You can use the Array_shift () function to delete the first element if you do not have the correct one.
Forget it, it's all a little problem, knot stickers.