Friday, 15 June 2012

string - Limiting the number of words PHP Magento Instant Search -


I'm trying to limit the number of words that are closing the page that appears. I have a small script used in some places but I can not get anything to work in this context. Here's the peace of code:

 } $ html = "& Lt; button type = 'button' class = 'button-search-purchase' onclick = 'javascript: document.productAddToCartForm.submit ()' & gt; & gt; duration & gt; $ Product_helper- & gt; __ (''). "& Lt; / span & gt; & lt; / button & gt;"; $ Html = "& Lt; / fieldset>"; } $ Html = "& Lt; div id = 'description' & gt; & lt; h4 style = 'margin: 5px 0 3px 0' & gt; span style = 'color: # e26703' & gt; mage :: helper ("List / product") - & gt; __ ("quick overview"). "& Lt; / Span & gt; & Amp; Nbsp; & Amp; Nbsp; & Lt; A style = 'font-size: 10px' href = '". $ Product_url.' 'Target =' _self '& gt;" $ product_helper- & gt; __ (' View Details'). "& Lt; / A & gt; & Lt; / H4> "$ PRODUCT-> Get TFTDCLICION () & lt; ------- OK." & Lt; / Div> "." & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Form> "$ $$" -> GetResponse () -> set header ('content-type', 'app / x-json'); $ this- & gt; GetResponse () - & gt; ; SetBody ($ HTML);   

Here are some code that I have found that works but I can not understand how this is in the form of this open type with php code as above Works.

  & lt ;; Php $ sdesc2 = $ _product- & gt; Millennight Works ($); $ Sdesc2 = trim ($ sdesc2); $ border = 120; if (strollen ( $ Sdesc2) & gt; $ limit) {$ sdesc2 = substr ($ sdesc2, 0, stropo (substream ($ sdesc2, 0, $ limit), ''));}? & Gt; & lt ;? php echo $ Sdesc2. " .. "? & Gt;    

   $ range) {$ sdesc2 = substr ($ sdesc2, 0, stropo (Substrost ($ sdesc2, 0, $ limit), ''));} ?? gt; $ html. = "& Lt; Div id = 'description' & gt; & Lt; H4 style = 'margin: 5px 0 3px 0' & gt; & Lt; Span style = 'color: # e26703' & gt; Mage :: helper "list / product") - & gt; __ ("Quick Overview"). "& Lt; / span & gt; & amp; nbsp; & amp; nbsp; & lt; a style = 'font-size: 10px' href = '". $ Product_url 'Target =' _self '& gt; "$ Product_helper- & gt; __ ('see details')." & Lt; / A & gt; & Lt; / H4 & gt; "$ Sdesc2." & Lt; / Div> "   

No comments:

Post a Comment