betweenQuotes.php
Table of Contents
Functions
- betweenQuotes() : string
- Wraps an expression in quotes or a custom character.
Functions
betweenQuotes()
Wraps an expression in quotes or a custom character.
betweenQuotes([mixed $expression = '' ][, string $char = "'" ][, bool $useQuotes = true ][, string $separator = ' ' ][, bool $trim = true ]) : string
- Strings are wrapped directly.
- Arrays are concatenated with the given separator, then wrapped.
- Wrapping can be disabled with the
$useQuotes
flag.
Parameters
- $expression : mixed = ''
-
The value to wrap (string, array, or any type convertible to string).
- $char : string = "'"
-
The quote or character to wrap around the expression (default: single quote
'
). - $useQuotes : bool = true
-
Whether to wrap the expression (default: true).
- $separator : string = ' '
-
Separator used to join array elements (default:
' '
). - $trim : bool = true
-
Whether to trim existing
$left
/$right
characters (default: true).
Tags
Return values
string —The resulting wrapped expression.