mightybh
Senior Member
- Feb 27, 2008
- 1,029
- 1,734
A simple get variable like this
<?php echo $_GET["var"]; ?>
When I go to my url something.php?var=this is a test
%20 is added to replace the spaces.
End result echos: this is a test
How do I remove the spaces completely so that I end up with: thisisatest? Any ideas?
I tried trim and $sometext = preg_replace('/\s+/', ' ', $sometext); but can't combine the two together.
Thanks!
<?php echo $_GET["var"]; ?>
When I go to my url something.php?var=this is a test
%20 is added to replace the spaces.
End result echos: this is a test
How do I remove the spaces completely so that I end up with: thisisatest? Any ideas?
I tried trim and $sometext = preg_replace('/\s+/', ' ', $sometext); but can't combine the two together.
Thanks!