Hi all,
Thanks to "laserlight" and "TheDefender" for thier help with this post.
Solution.
Function provided by "laserlight"
function formatStr1($str) {
return $str{0} . " "
. substr($str, 1, 5) . " "
. substr($str, 6, 3) . " "
. $str{9};
}
function formatStr2($str) {
return $str{0} . "-"
. substr($str, 1, 6) . "-"
. substr($str, 7, 2) . "-"
. $str{9};
}
Code provided by "TheDefender"
if(substr("182920290", 0, 2) == "18"){
echo formatStr1($row_record_filter['isbn_paperback']);
} elseif(substr("182920290", 0, 2) == "19"){
echo formatStr2($row_record_filter['isbn_paperback']);
}
Many thanks to both of you.
Job done.
Kind regards, keep safe and well.
Dereck