apply htmlspecialchars to maxWords

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 22, 2011   (RSS)

Re: [zick] apply htmlspecialchars to maxWords

By Jason - June 22, 2011

Hi,

Do you mean you want to apply htmlspecialchars to the output of maxWords, or to the HTML that you're passing into it?

You can do both, For example:

<?php echo htmlspecialchars(maxWords($record['media'], 20)); ?>

OR

<?php echo maxWords(htmlspecialchars($record['media']), 20); ?>

Is this what you're looking for?

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] apply htmlspecialchars to maxWords

By Zicky - June 22, 2011

Hi,

Do you mean you want to apply htmlspecialchars to the output of maxWords, or to the HTML that you're passing into it?

You can do both, For example:

<?php echo htmlspecialchars(maxWords($record['media'], 20)); ?>

OR

This is what I needed... Thanks Jason!
<?php echo maxWords(htmlspecialchars($record['media']), 20); ?>

Is this what you're looking for?

Hope this helps