Hello everyone,
I am trying to learn how to use ereg_replace(), but I don't seem to be
doing it correctly.
$phone is a 10-digit string.
I want to perform the following:
$phone = ereg_replace(.{10}, [part where I am confused], $phone);
I would like the output to be
$phone = (555) 555-;
Hi Erik,
$phone is a 10-digit string.
I would like the output to be
$phone = (555) 555-;
you don't need regex to do that.
just insert add ( to the beginning of $phone,
add ) to the 4th position,
and - to the 4th position from behind,
using substr_replace() function.
anyway if you
2 matches
Mail list logo