PHP Classes

File: manuscript/Working with Pimf_Util_Json.md

Recommend this page to a friend!
  Classes of Gjero Krsteski   PIMF   manuscript/Working with Pimf_Util_Json.md   Download  
File: manuscript/Working with Pimf_Util_Json.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PIMF
Framework for Web application development
Author: By
Last change: Update of manuscript/Working with Pimf_Util_Json.md
Date: 5 months ago
Size: 505 bytes
 

Contents

Class file image Download

Json

In PHP we have some nifty functions named json_encode() and json_decode() and PIMF makes great use of these. Why? Because JSON is very easy to read and convenient for storing arrays and objects with values as strings.

Encode

$json = \Pimf\Util\Json::encode($item);

Decode

$item = \Pimf\Util\Json::decode($json);

What can I put into JSON?

You can use any of the following data types in your JSON:

  • Double
  • Float
  • String
  • Boolean
  • Array
  • Object
  • Null