PHP

PHP Menu

PHP

quotemeta() Function - Definition, Syntax, Parameters, Examples

Definition

The quotemeta() function adds backslashes in front of some predefined characters in a string.

Predefined characters:

  • period (.)
  • backslash (\)
  • plus sign (+)
  • asterisk (*)
  • question mark (?)
  • brackets ([])
  • caret (^)
  • dollar sign ($)
  • parenthesis (())

Syntax

quotemeta(string)

Parameters

Parameter Description
string Required. Specifies the string to check.

Example

<?php
$hello = "Hello world? (Greetings!)"; echo quotemeta($hello);

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods