Top "Str-replace" questions

This function returns a string or an array with all occurrences of search in subject replaced with the given replace value.

Cannot work out a php str_replace() to remove comma

In a PHP project, I have: $string = "1,555"; str_replace(',', '', $string); echo $string; //is still 1,555 str_replace does …

php string str-replace comma
How to replace/escape U+2028 or U+2029 characters in PHP to stop my JSONP API breaking

Ok I am running a public JSONP API which the data is served from my PHP server. I just read …

php escaping jsonp str-replace json
How can I replace white space in filename of uploaded file

I'm making a SWF uploader and have my HTML form done. It works totally fine until I upload a SWF …

php regex preg-replace str-replace
String Replace - Add Slash Before Single Quote

I'm trying to escape a single quote within my PHP by adding a slash before it. Unfortunately, I've been unable …

php str-replace
jQuery, Get filename without the extension and then replace string

I have this code to get the file extension: filename1 = "a.crudely_formed.document_name.jpg" var fileExtension = filename1.substring(…

jquery regex str-replace
PHP replace string with values from array

I have a string such as: Hello <%First Name%> <%Last Name%> welcome and I have a …

php regex preg-replace preg-match str-replace
Javascript Replacing All Instances of New Line Character ASCII (13) with "\r\n"?

How can I replace all instances of a newline character ASCII code (13) in a string with "\r\n"? Any help …

javascript newline str-replace
PHP: "... variables can be passed by reference" in str_replace()?

I created a function to print a prepared-statement-sql-string with the variables in it, based on what I found in this …

php pass-by-reference str-replace
Can't get str_replace() to strip out spaces in a PHP string

Hi, I am getting a PHP string which I need to strip the spaces out of. I have used the …

php string str-replace
php how to make a if str_replace?

$str is some value in a foreach. $str = str_replace('_name_','_title_',$str); how to make …

php str-replace