"."/> ".">
Home >Backend Development >PHP Problem >How to remove quotes in php
How to remove quotation marks in php: First create a PHP sample code file; then use the "str_replace()" function to replace the quotation marks ["]. The code statement is "c0300912c7bff20969104d3923d66a2f".
##php remove quotation marks
<?php $s=str_replace('"','', $str); ?>Use str_replace() functionReplace the words containing double quotes "Another example should be easy to understand at a glance:
<?php echo $s=str_replace("one","two", "hello one"); ?>This output is hello two
str_replace() Function introduction:
str_replace() function replaces some characters in the string (case sensitive). This function must follow the following rules: If you search The string is an array, then it will return an array.If the searched string is an array, then it will find and replace each element in the array. If an array needs to be searched and replaced at the same time, and the elements that need to be replaced are less than the number of found elements, the excess elements will be replaced with empty strings. If it is an array Search, but only replace a string, then the replacement string will work on all found values. Note: This function is case-sensitive. Please use the str_ireplace() function to perform Case-sensitive search.Note: This function is binary safe.Syntaxstr_replace(find,replace,string,count)Parameters find Required. Specifies the value to find . replace required. Specifies the value to replace the value in find. string required. Specifies the string to be searched. count Optional. A variable, for replacement Count numbers. Recommended: "
PHP Tutorial"
The above is the detailed content of How to remove quotes in php. For more information, please follow other related articles on the PHP Chinese website!