Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$text = 'it is apparent why many are in the favour of the above stance. Another argument';
$offset_arr = [1, 7, 25, 36, 56];
$substr=[];
$offset_count=0;
foreach($offset_arr as $i => $offset)
{
$limit = ($offset_arr[$i+1] ?? strlen($text)+2) - $offset;
$substr[] = substr($text, $offset-1, $limit);
}
var_dump($substr);