Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExportUtil.php

function ExportUtil::export

Exports a value as a string

The output of this method is similar to the output of print_r(), but improved in various aspects:

  • NULL is rendered as "null" (instead of "")
  • TRUE is rendered as "true" (instead of "1")
  • FALSE is rendered as "false" (instead of "")
  • Strings are always quoted with single quotes
  • Carriage returns and newlines are normalized to \n
  • Recursion and repeated rendering is treated properly

Parameters

mixed $value:

int $indentation The indentation level of the 2nd+ line:

Return value

string

1 call to ExportUtil::export()
StringUtil::stringify in vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php
Stringifies any provided value.

File

vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php, line 40

Class

ExportUtil
This class is a modification from sebastianbergmann/exporter

Namespace

Prophecy\Util

Code

public static function export($value, $indentation = 0) {
    return self::recursiveExport($value, $indentation);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal