Echo json_encode ($ return_data, JSON_NUMERIC_CHECK); the character 'e' in numbers does not work

one of the lines of my db has a contact table has a character distinguished by a column, like a phone with a value of 3162e6313358

$return_data = array('phone' => $contact_phone);
echo json_encode($return_data, JSON_NUMERIC_CHECK);

this code does not give me any output. I was looking for people who offered solutions such as ('phone' => '". $ Contact_phone."') This works. I do not want a type for each element of the array But I need a general solution.

Thank.

+4
source share
1 answer

Option 1 (best)

  • (IDs, counts, numeric status codes, booleans a.s.o.) , ($_GET[], $_POST[]) . , .

  • ; , , , . , , : , .

  • JSON_NUMERIC_CHECK json_encode(); # 1 , .

2 ( )

(' ') , . ( ), -.

json_encode() , + 0.

+1

All Articles