2017 © Pedro Peláez
 

library jsobj2php

Convert into php array from javascript object

image

osushi/jsobj2php

Convert into php array from javascript object

  • Saturday, February 10, 2018
  • by Osushi
  • Repository
  • 1 Watchers
  • 2 Stars
  • 66 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 20 % Grown

The README.md

jsobj2php

Packagist, (*1)

Functions

  • Convert into php array from javascript object

Requirements

  • PHP >= 7.0.*

Usage

composer require osushi/jsobj2php

Examples

See: https://github.com/Osushi/jsobj2php/blob/master/example.php, (*2)

<?php
require_once 'vendor/autoload.php';

use JsObj2Php\Converter;

$str = '{
baseprice:3300,
items:[{id:1,price:1000,commnet:"foo",memo:[]},{id:2,price:2000,memo:[]}],
counts:[10, 20],
message:"ほげ",
pickup:{id:1,price:1000,commnet:"foo",memo:[0, 1, 2]}
}';

var_export(Converter::execute($str, true)); // If here sets `Converter::execute($str)`, you can get stdClass object.
/*
array (
  'baseprice' => 3300,
  'items' =>
  array (
    0 =>
    array (
      'id' => 1,
      'price' => 1000,
      'commnet' => 'foo',
      'memo' =>
      array (
      ),
    ),
    1 =>
    array (
      'id' => 2,
      'price' => 2000,
      'memo' =>
      array (
      ),
    ),
  ),
  'counts' =>
  array (
    0 => 10,
    1 => 20,
  ),
  'message' => 'ほげ',
  'pickup' =>
  array (
    'id' => 1,
    'price' => 1000,
    'commnet' => 'foo',
    'memo' =>
    array (
      0 => 0,
      1 => 1,
      2 => 2,
    ),
  ),
)
*/

The Versions

10/02 2018

dev-master

9999999-dev https://github.com/Osushi/jsobj2php

Convert into php array from javascript object

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

js object convert

10/02 2018

0.0.3

0.0.3.0 https://github.com/Osushi/jsobj2php

Convert into php array from javascript object

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

js object convert

10/02 2018

0.0.2

0.0.2.0 https://github.com/Osushi/jsobj2php

Convert into php array from javascript object

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

js object convert

09/02 2018

0.0.1

0.0.1.0 https://github.com/Osushi/jsobj2php

Convert into php array from javascript object

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

js object convert