splitSentence

splitSentence ( string html , int _nbOfCaraters ) : array

Split a html in two part. The first part will have a length lower than _nbOfCaraters and the second part is the rest. For that this function use points ".", new lines and tags like
of

. If not possible it try to cut at word. The split is done to preserve complete sentences.
An array is returned

For prestashop we recommand 400 caracters max for nbOfCaraters

Example


html = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make'
twoParts = splitSentence(html, 100)

console( get(twoParts, 0) ) // -> first part (less than 100 caracters and finish at the point) : "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
console( get(twoParts, 1) ) // -> second part : "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make"

Parameters

html

_nbOfCaraters (optional)

maximum number of caracters of the first part