php trim whitespace left and right code example
Example: remove whitespace from string php
$str = "\n\n\nHello World!\n\n\n";
echo "With trim: " . trim($str);
$str = "\n\n\nHello World!\n\n\n";
echo "With trim: " . trim($str);