Yani, ben gibi bir dize varsa
"hello what is my name"
Nasıl alanlarda tüm almak ve tek bir boşluk ile her değiştirebilirsiniz?
Bu yapmak gerekir:
$replaced = preg_replace('/\s\s+/', ' ', $text);
Output:
hello what is my name
Çözüm bulundu:
<?php $str = ' This is a test '; $count = 1; while($count) $str = str_replace(' ', ' ', $str, $count); ?>