- substr: documentation ( source)
- str_replace: documentation ( source)
<?php
while(strlen($sms) > 160) {
echo "Here";
$short = substr($sms,0,159);
echo "Send SMS Long";
$sms = str_replace($short,'',$sms);
}
if(strlen($sms) > 0) {
echo "Send SMS Short";
}
?>