Posts Tagged ‘json’

Fluent Arrays and Strings in PHP - Adding JSON and more

Friday, July 11th, 2008

Table of Contents for Fluent interfaces in PHP

  1. Fluent Arrays and Strings in PHP
  2. Fluent Arrays and Strings in PHP - Adding JSON and more

Recently I’ve had the need to extend the interface further, among other things with JSON support. I’ve used code published by Nicolas Crovatti to do this. There was one line in there though that wasn’t consistent with its purpose. If you use that code you have to replace if($i != $keys[$i]) with if($i !== $keys[$i]). On the other hand if you use PHP >= 5.2 you don’t need this function at all, you use json_encode instead.... Read More