Q:

Write a PHP script that removes the whitespaces from a string

0

Write a PHP script that removes the whitespaces from a string.

Sample string : 'The quick " " brown fox'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$str1 = 'The quick " " 	 brown fox';
echo preg_replace('/\s+/', '', $str1)."\n";
?>

Sample Output:

Thequick""brownfox

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now