Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

code explanation ::: please explain


moyashi

Recommended Posts

Posted

$reviews_values = tep_db_fetch_array($reviews);



$reviews_text = htmlspecialchars($reviews_values['reviews_text']);

$reviews_text = tep_break_string($reviews_text, 60, '-<br>');

 

Ok, a bit of code from reviews. I understand the db calls then the changes to variables, but ... it's this tep_break_string that has me .... what's this "60" about ...

 

I've been trying to get a solution from not being able to see line breaks and I realized that reviews have been doing them nicely all along!!!

 

so would somebody mind helping?

NewsDesk(934) / FAQDesk(1106) / OrderCheck(1168) :::

Posted

here's code from the catalog/includes/functions/general.php file :

 

////

// Break a word in a string if it is longer than a specified length ($len)

 function tep_break_string($string, $len, $break_char = '-') {

 

i would assume by the comment and the function header that the number 60 is the number of characters permited in a word before it wraps. it will use a hyphen as a break unless another parameter like the html <br> is passed.

 

-rob

Posted

:oops: ugh, 3am posts are too intelligent. :roll:

 

Thanks Rob!

 

yes, that does make sense.

NewsDesk(934) / FAQDesk(1106) / OrderCheck(1168) :::

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...