0

I am doing rest API call and getting array of object. It is returning integer data type on localhost for id and customer_id.

  1. While returning strings for id and customer_id
    • [{"id":4,"name":"x","customer_id":5}]
  2. On hosted server. Why different behavior ?
    • [{"id":"4","name":"x","customer_id":"5"}]
Sherif
  • 11,786
  • 3
  • 32
  • 57
Honey Thakuria
  • 223
  • 3
  • 16
  • 1
    You should definitely include the code that you used, which provided the unexpected result. Otherwise, we're just guessing what may or may not have caused such unexpected results. – Sherif Sep 20 '16 at 18:39
  • 1
    http://stackoverflow.com/a/31527918/188282 ? – Adiasz Sep 20 '16 at 18:41
  • Possible duplicate of [PHP + PDO + MySQL: how do I return integer and numeric columns from MySQL as integers and numerics in PHP?](http://stackoverflow.com/questions/20079320/php-pdo-mysql-how-do-i-return-integer-and-numeric-columns-from-mysql-as-int) – patricus Sep 20 '16 at 19:16

0 Answers0