if (length($str) > $index) { $s = substr($str, $index, 1); } else { whatever else } [download]
In reply to Re^3: substr outside of string by Anonymous Monk in thread substr outside of string by kulls