Write a PHP script that removes the whitespaces from a string

  • برمجة بي اتش بي

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

Sample string : 'The quick " " brown fox'

الأجوبة

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

Sample Output:

Thequick""brownfox
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...