How to remove user input unnecessary white-space/character in php

preview_player
Показать описание
In this how to remove user input unnecessary white space/character in php tutorial, I have showed that how to remove whitespace or character in php by using php building function trim(). Actually when you work with form & you want to get a specific data from your users, you need to use this trim function of php. This trim function will help you to remove unwanted character or white spaces from user input data.

Also you can specific remove white space or character by using php rtrim function or ltrim function. For removing right side white space or character just use php rtrim function but if you want to remove left side white-space or character just use ltrim function of php.

Here I have showed with live examples & hope you will enjoy this video.

If you think you need more help, so just join our community at:
Рекомендации по теме
Комментарии
Автор

hello sir i made a search box for searching queries to dispay in browser froma database but i cant remove whitspace from user input Lisa

pjmclenon
Автор

When iam trying to store the trimmed data in It is getting stored in the db with spaces only... How do I remove spaces while storing In db

DACS_VJHarshita
Автор

If I want to remove all space between letters what should I do Sir? Example: John Doe to johndoe

mostafinbabu
Автор

<input type="text" name="search" class="form-control" value="<?php if(isset ($_GET["search"])) echo TRIM($_GET["search"]); ?>" />
<br />

this line of code is not working
it doesnt remove whitespace and so the query rsult is wrong it includes whitespace

pjmclenon
join shbcf.ru