Remove spaces in field
I have a database of names of people in this format
First Second
I want to take these names from the URL then REMOVE THE WHITE SPACES in the middle of the URL then add .gif to the end to turn it into the reference for an image.
So I want to get this out: FirstSecond.gif
I have read through all the other posts on similar questions, but nothing seems to work!
I am using this code (not that I understand it) to do the stripping.....
<?php
$sTestString = '<?php echo ($_GET['secondary']); ?>';
$sPattern = '/\s*/m';
$sReplace = '';
echo preg_replace( $sPattern, $sReplace, $sTestString ); ?>
I get this error:
Parse error: syntax error, unexpected T_STRING in /content/HostingPlus/h/a/hands-together.org/web/testspaces.php on line 3
Any ideas? or is there something REALLY simple I can do in formats to get this to work. It seems so basic !
Thanks
