meuon,
@meuon@fosstodon.org avatar

New WTF?!? that has me wanting to thwack an API providers team:

In one place it needs (without quotes)

"invoiceTotal": 17.37,

In another it needs; (with quotes)

"invoiceTotal": "17.37",

but if I pass 17.37 (bare) to PHPs json_encode it wraps it in quotes. I can't use JSON_NUMERIC_CHECK because it breaks the things that should be strings like "01" instead of 1.

There are kludgy work arounds... or I can hand code my JSON, but WTF?!?

#PHP #JSON

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • magazineikmin
  • thenastyranch
  • Youngstown
  • Durango
  • rosin
  • slotface
  • InstantRegret
  • mdbf
  • PowerRangers
  • kavyap
  • tsrsr
  • everett
  • ngwrru68w68
  • Leos
  • hgfsjryuu7
  • cubers
  • GTA5RPClips
  • khanakhh
  • vwfavf
  • ethstaker
  • osvaldo12
  • cisconetworking
  • tester
  • tacticalgear
  • modclub
  • normalnudes
  • anitta
  • All magazines