i'm creating a photo sharing system with a particular photo temp verify. Basically, on input file submit photos are loaded into a dir called "temp".
I change the name of file in a particular string like this 3_1383310890_1709373616.jpg
where 3 is the user_id 1383310890 is the date and 1709373616 is a random code name.
Now, if user doesn't complete the form... the next time, it should checks if exist a file temp for that user id and i would get info like this way but I do not understand why it does not work.
$string = 'temp/3_1383310890_1709373616.jpg';
preg_match_all('/^[0-9]+_/',$string,$match);
$arr = array('user' => $match[1][0], 'date' => $match[2][0], 'photo' => $match[3][0]);
echo json_encode($arr);
it returns null objects
{"user":null,"date":null,"photo":null}
Any ideas ?