$string = \'Some string\';
$pos = 5;
...??...
$begging // == \'Some s\';
$end // == \'tring\';
What is the best way to separate string in two by
What is the best way to separate string in two by given position?
If i understand you correctly, you can do:
$str = 'hello world';
$pos = 5;
$separated_str = substr($str, $pos);
echo $separated_str;
Result:
world
This depends on the structure of your string as there are other ways also to split the string.