remove space from string php
snippet in php

remove spaces from string php

user6303

<?php
$phone = preg_replace( '/\s+/', '', "01234 567890" );
echo $phone;

remove space from string php

user6616

<?php
$stripped = str_replace(' ', '', "10 1000 0000 000");
echo $stripped;

remove every whitespace php

user9053

$string = preg_replace('/\s+/', '', $string);

remove whitespace from string php

user1277

$str = "\n\n\nHello World!\n\n\n";
echo "With trim: " . trim($str);

how to trim string in laravel

user3684

{{ \Illuminate\Support\Str::limit($productVal, 20, $end='...') }}