<?php declare(strict_types=1); $s = "abc"; // index a string like an array echo $s[0], $s[2], "\n"; // negative index counts from the end echo $s[-1], "\n";
read one byte with [i]