User Profile

Collapse

Profile Sidebar

Collapse
hodja451
hodja451
Last Activity: Jan 24 '10, 05:18 PM
Joined: Jan 24 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hodja451
    replied to How can I combine strip_tags and substr ?
    in PHP
    Thanks for the reply!

    I wasn't using substr, because however I placed it, I broke the code, I needed to know how to place it.

    I worked on this for hours before asking, then I found the solution 5 minutes after asking.

    I just changed

    strip_tags($lis ting['products_descr iption'], '<br>')

    to

    substr(strip_ta gs($listing['products_descr iption'], '<br>'), 0, 100...
    See more | Go to post

    Leave a comment:


  • hodja451
    started a topic How can I combine strip_tags and substr ?
    in PHP

    How can I combine strip_tags and substr ?

    I want to strip tags and return the first x characters. Every combo I try fails.

    The code below is where I'm at. It works perfectly stripping the tags, it fails when I try to add substr to limit the length. Not that it should matter, but this is within an Oscommerce setup.


    Code:
    else {
                  $lc_text = '&nbsp;<big><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath='
    ...
    See more | Go to post
    Last edited by Dormilich; Jan 24 '10, 10:15 PM. Reason: Please use [code] tags when posting code
No activity results to display
Show More
Working...