Yarma html dize kadar çok kelime sonra

0 Cevap

Ben 10 kelime diyelim daha uzunsa, iki parçaya bölmek istediğiniz bir dize var. İkinci bölüm başka-nerede 'more' bağlantısını sonra dahil edilecektir.

The string will hold html tags too though. For an example the string could be:

<p>This is just a test string with more words than the <strong>amount allow</strong> before split, blah blah blah</p>

Yani durumda ben isterim:

$string[0] // <p>This is just a test string with more words than</p>;
$string[1] // <p>the <strong>amount allow</strong> before split, blah blah blah</p>;

Şimdiden teşekkürler

0 Cevap