Jump to content

Recommended Posts

[!--quoteo(post=357525:date=Mar 23 2006, 09:13 AM:name=rach)--][div class=\'quotetop\']QUOTE(rach @ Mar 23 2006, 09:13 AM) [snapback]357525[/snapback][/div][div class=\'quotemain\'][!--quotec--]
i have a list of phone number key in with 012-34567897
i want to split the '-' so that the phone number become 01234567897.

anyone knows how to do that ? thanks
[/quote]

i guess this would do you:

[code]
$num = str_replace('-', '', $num);
[/code]

hope that helps
[!--quoteo(post=357528:date=Mar 23 2006, 09:23 AM:name=rach)--][div class=\'quotetop\']QUOTE(rach @ Mar 23 2006, 09:23 AM) [snapback]357528[/snapback][/div][div class=\'quotemain\'][!--quotec--]
anyway we can do that using sql command ?
[/quote]

you'd have to check, but something like:

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] REPLACE(Telnum, [color=red]'[span style=\'color:orange\']-[/color]'[/span], '') [color=green]as[/color] NiceTelnum [color=green]FROM[/color] [color=orange]mytable[/color] [!--sql2--][/div][!--sql3--]

may work for you
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.