json being a pain (or is it PHP being a pain?)