Skip to content

Repository files navigation

PHP Data Converter

Convert between PHP Serialized, PHP array literal (short array syntax), and JSON from your editor.

Demo

PHP Data Converter Demo

Commands

  • Convert: PHP Serialized → JSON
  • Convert: PHP Serialized → PHP Array
  • Convert: JSON → PHP Array
  • Convert: JSON → PHP Serialized
  • Convert: PHP Array → JSON
  • Convert: PHP Array → PHP Serialized

Use the Command Palette and paste your data, or select a range in the editor and run the command to replace in-place.

Notes

  • PHP array parsing uses php-parser. It expects a PHP array literal like:
[
  'name' => 'Alice',
  'roles' => ['admin', 'editor'],
  'active' => true,
  'age' => 30,
  'meta' => ['a' => 1, 'b' => null]
]
  • PHP serialization uses php-serialize.
  • JSON conversion uses the built-in JSON parser/stringifier.

License

MIT

About

A VS Code extension to seamlessly convert between PHP Serialized strings, PHP array literals, and JSON. Provides commands to transform selected text or the entire file with one click or shortcut.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages