The quotemeta() function adds backslashes in front of below characters.
The predefined characters are:
period (.)
backslash (\)
plus sign (+)
asterisk (*)
question mark (?)
brackets ([])
caret (^)
dollar sign ($)
parenthesis (())
[table caption=”” width=”100%” colwidth=”15%|15%|15%|55%” colalign=”left|lef|lef|left”]
Name, Required /Optional, Value Type, Description
string , Required, String , It is the input string.
[/table]
Returns the string with meta characters quoted, or FALSE if an empty string is given as string.
<?php $str = "Hi All. Thanks for reading my tutorials+!."; echo quotemeta($str); ?>
Output of above code in the browser is as below:
<?php $strEg1 = "2 + 2 = 4"; $strEg2 = "3 * 2 = 6"; $strEg3 = "How are you?"; $strEg4 = "Are you Fine? (Yes, I am..)"; $strEg5 = "The caret [ ^ ] Looks like a hat!"; echo quotemeta($strEg1)."\n"; echo quotemeta($strEg2)."\n"; echo quotemeta($strEg3)."\n"; echo quotemeta($strEg4)."\n"; echo quotemeta($strEg5)."\n"; ?>
Output of above code in the browser is as below:
App usage is growing steadily without showing any signs of slowing down. Hence, it is no surprise that mobile applications…
As the world has grown more digital, businesses have adapted themselves. An effectual adaptation includes online advertising. Offline advertising styles…
Step into a world where apps dance to the user's tune. Picture Instagram, a photo-sharing sensation that swept the globe.…
COVID-19 has led to a digitalization of lifestyle. As patients are taking their mental and physical health more seriously, healthcare…
Introduction WordPress, an immensely popular content management system (CMS), powers over 40% of the internet. What makes WordPress even more…
For moving companies trying to capture their market share amidst stiff competition, a tip or two about what they can…