I would like to know if there is possible to split a text in two parts.
On my website I have a product description (500-1000 words) and I would like to display it like so:
<div class="text-col">
<?php echo nl2br($col1); ?>
</div>
<div class="text-col">
<?php echo nl2br($col2); ?>
</div>
Something like this?
$len = strlen($input);
$space = strrpos($input," ",-$len/2);
$col1 = substr($input,0,$space);
$col2 = substr($input,$space);
// now output it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With