There is one thing i dont get.
You foreach
the tags as t right?
And in the foreach
you pass it again in an array
? than you encode
it? why?
And the second please provide a bit more details and code.
I can only help you this way with these details.
if you place the folowing code.
foreach ( $tags as $t ) {
echo "<pre>";
print_r(json_encode($t));
}
you will get the following result
// encoded to json
{"tag_uid":"100001701664011","x":100,"y":100}
{"tag_uid":"100001726935992","x":100,"y":230}
{"tag_uid":"100001628449733","x":100,"y":360}
{"tag_uid":"100001286641924","x":230,"y":100}
{"tag_uid":"100001785887853","x":230,"y":230}
so you only need to do this
foreach ( $tags as $t ) {
$tagRes = json_encode($t);
}
just pass the t in a variable and encode it there.
Please provide more code
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…