1.
function
phoneFormat(
$phone
,
$delimeter
=
' '
)
2.
{
3.
return
substr
(
$phone
, 0, 3).
$delimeter
.
substr
(
$phone
, 3, 3).
$delimeter
.
substr
(
$phone
, 6);
4.
}
5.
echo
phoneFormat(
'08123456789'
);
6.
echo
'<hr>'
;
7.
echo
phoneFormat(
'08123456789'
,
'-'
);