Unwanted space after record is called

5 posts by 3 authors in: Forums > CMS Builder
Last Post: May 22, 2013   (RSS)

By dccreatives - May 22, 2013

I have a code that I am calling  <?php echo $record['mounting-french']?>

After it gives me the record I wanted to add an 'S' to pluralize. <?php echo $record['mounting-french']?>S

However, it is giving me a space after the record so it has the record space and then the 's' Anyway to work around this?

This is the result:

SUSPENSION S where suspension is the record and the S is coming after a space.

I am attaching my page.

You can see it online here: 

http://www.axislighting.com/CMS_french/GalleryList.php?mounting-french=suspension

Please advise how I can remove the space

Attachments:

gallerylist_001.php 6K

By gregThomas - May 22, 2013

Hi,

I would try using the PHP function trim, this will remove any white spaces from the beginning or end of your variables:

<?php echo trim($record['mounting-french'])?>S

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By dccreatives - May 22, 2013

I found the issue. I regenerated the code and got this: <?php echo join(', ', $record['mounting-french:values']); ?>S

That worked without a space.

By gkornbluth - May 22, 2013 - edited: May 22, 2013

Glad you fixed it.

There's a (free) plugin that Dave Edis from Interactive Tools developed a while ago to insure that blank spaces and dates do not mess up your code.

You can download it from the CMSB Cookbook download center at:

http://www.thecmsbcookbook.com/downloads/removeExtraWhitespace2.zip

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php