Код: Выделить всё
$thetextstring = "jjfnj 948"
Код: Выделить всё
echo $thetextstring; // should print jjf-nj948
Пока да
Код: Выделить всё
$string = trim(preg_replace('/s+/', ' ', $thetextstring));
$result = explode(" ", $thetextstring);
$newstring = implode('', $result);
print_r($newstring);
Подробнее здесь: https://stackoverflow.com/questions/488 ... hes-in-php
Мобильная версия