Logo

Programming-Idioms

History of Idiom 38 > diff from v3 to v4

Edit summary for version 4 by :

Version 3

2015-08-01, 17:11:00

Version 4

2015-08-20, 06:58:58

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Code
$t = mb_substr($s, $i, $j-$i, 'UTF-8');
Comments bubble
/* requires multibyte (mb) extension for unicode support */