# Stripping the whitespace - PHP/MySQL

**URL:** <https://forum.kirupa.com/t/stripping-the-whitespace-php-mysql/187725>\
**Category:** programming\
**Created:** [May 1, 2006, 10:04pm UTC](https://forum.kirupa.com/t/stripping-the-whitespace-php-mysql/187725 "2006-05-01T22:04:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zicemaster](https://avatars.discourse-cdn.com/v4/letter/z/b77776/32.png) [@zicemaster](https://forum.kirupa.com/u/zicemaster)\
**Post date:** [May 1, 2006, 10:04pm UTC](https://forum.kirupa.com/t/stripping-the-whitespace-php-mysql/187725/1 "2006-05-01T22:04:18Z")

</div>

I’m trimming the spaces here…

```php

        $userName = rtrim($userName, ' ');
         $userName = ltrim($userName, ' ');
         $userShout = rtrim($userShout, ' ');
         $userShout = ltrim($userShout, ' ');

```

But how do I trim the extra lines at the start and end of userShout? In case someone accidentally holds down the enter key and messes up the formatting.

Flash doesn’t use "  
" or " " or “\r” or \h or \v or \0… I can’t figure out what to trim…
