Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>php serialized string formatterNew to Visual Studio Code? Get it now.
php serialized string formatter

php serialized string formatter

Zheng Dai

|
346 installs
| (0) | Free
Formats PHP serialized strings by adding indentation and line breaks for better readability.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PHP Serialized String Formatter

Version License

Overview

PHP Serialized String Formatter is a Visual Studio Code extension designed to enhance the readability of PHP serialized strings. It automatically formats serialized data by adding indentation and line breaks, making it easier to debug and maintain serialized structures within your PHP projects.

Logo

Features

  • Automatic Formatting: Format selected serialized strings or entire documents with a simple command.
  • Customizable Keybinding: Trigger formatting using a keyboard shortcut.
  • Language Support: Optimized for PHP and plaintext files.
  • Handles Escaped Characters: Properly manages escaped quotes and other serialized data nuances.
  • User-Friendly Notifications: Receive confirmation messages upon successful formatting or error alerts for invalid serialized strings.

Installation

You can install the extension directly from the Visual Studio Code Marketplace or manually via the .vsix file.

Install from Marketplace

  1. Open Visual Studio Code.
  2. Navigate to the Extensions view by clicking the Extensions icon in the Activity Bar or pressing Ctrl+Shift+X (Cmd+Shift+X on macOS).
  3. Search for "PHP Serialized String Formatter".
  4. Click Install on the extension by twindai.

Install from VSIX

  1. Download the .vsix file from the releases page or your project's repository.
  2. Open Visual Studio Code.
  3. Navigate to the Extensions view.
  4. Click on the three-dot menu (...) in the top-right corner.
  5. Select Install from VSIX....
  6. Browse and select the downloaded .vsix file.
  7. Reload VSCode when prompted.

Usage

Formatting Serialized Strings

You can format PHP serialized strings either by selecting the specific portion of text or by formatting the entire document.

  1. Select the Serialized String:

    • Highlight the serialized string you want to format.
    • Press the formatting keybinding (Ctrl+Alt+F).

    OR

  2. Format Entire Document:

    • Ensure no text is selected.
    • Trigger the formatter using the keybinding or Command Palette.

Using the Command Palette

  1. Open the Command Palette by pressing Ctrl+Shift+P (Cmd+Shift+P on macOS).
  2. Type Format PHP Serialized String and press Enter.

Keybindings

By default, the extension uses the following keybinding:

  • Format PHP Serialized String: Ctrl+Alt+F (Windows/Linux) | Shift+Option+F (macOS)

You can customize the keybinding by modifying your VSCode keyboard shortcuts:

  1. Open Keyboard Shortcuts by pressing Ctrl+K Ctrl+S (Cmd+K Cmd+S on macOS).
  2. Search for Format PHP Serialized String.
  3. Click on the pencil icon to assign a new keybinding.

Keybinding Configuration

Example

Before Formatting:

"a:5:{s:26:""itinerary_pricing_category"";b:0;s:15:""itinerary_types"";a:4:{i:0;O:7:""WP_Term"":10:{s:7:""term_id"";i:0;s:4:""name"";s:7:""gloable"";s:4:""slug"";s:7:""gloable"";s:10:""term_group"";i:0;s:16:""term_taxonomy_id"";i:0;s:8:""taxonomy"";s:15:""itinerary_types"";s:11:""description"";s:0:"""";s:6:""parent"";i:0;s:5:""count"";i:1;s:6:""filter"";s:3:""raw"";}...}"
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft