0
Welcome Guest! Login
0 items Join Now

SOLVED Limit PHP Echo Call

    • Carl V's Avatar
    • Carl V
    • Sr. Rocketeer
    • Posts: 148
    • Thanks: 1
    • Real Estate Investor

    SOLVED Limit PHP Echo Call

    Posted 14 years 4 months ago
    • I'm sorry to have to do this but I've seriously checked every website and posted on other forums and no response.

      I'm trying to limit the php echo call of the description to about 80 characters

      This is the original code
      Code:
      <?php echo JText::_($item->description). '<br>' ?>

      but I don't know how to put the subtract string in or limit the output of the echo to 80 characters.

      I've done research online but I can't figure how to write it correctly.

      Please help
    • Last Edit: 14 years 4 months ago by Carl V.
    • Carl V's Avatar
    • Carl V
    • Sr. Rocketeer
    • Posts: 148
    • Thanks: 1
    • Real Estate Investor

    Re: SOLVED Limit PHP Echo Call

    Posted 14 years 4 months ago
    • Got a solution...
      <?php echo substr($item->description, 0, 80); ?>

Time to create page: 0.059 seconds