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

Breadcrumb

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

function Escaper::escapeWithSingleQuotes

Escapes and surrounds a PHP value with single quotes.

Parameters

string $value A PHP value:

1 call to Escaper::escapeWithSingleQuotes()
Inline::dump in vendor/symfony/yaml/Inline.php
Dumps a given PHP variable to a YAML string.

File

vendor/symfony/yaml/Escaper.php, line 91

Class

Escaper
Escaper encapsulates escaping rules for single and double-quoted YAML strings.

Namespace

Symfony\Component\Yaml

Code

public static function escapeWithSingleQuotes(string $value) : string {
    return \sprintf("'%s'", str_replace('\'', '\'\'', $value));
}

API Navigation

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