getQuoteChar.php
Table of Contents
Functions
- getQuoteChar() : string|null
- Returns the opening quote character used to wrap a string, or `null`.
Functions
getQuoteChar()
Returns the opening quote character used to wrap a string, or `null`.
getQuoteChar(string $value) : string|null
Useful when you need to know which quote style was used in order to round-trip a value (unquote → transform → rewrap with the same style).
Recognised pairs:
'…'single quotes → returns"'""…"double quotes → returns'"'`…`backticks → returns''`«…»French guillemets → returns'«'“…”English typographic → returns'“'‘…’English typographic → returns'‘'
Parameters
- $value : string
-
The string to inspect.
Tags
Return values
string|null —The opening quote character, or null if the value
is not wrapped in a known matching pair.