Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

eregi_replace()

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Postby Oleg Butuzov » Thu Jan 02, 2003 12:09 am

Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby sarah » Fri Jan 10, 2003 12:01 pm

I am certain there is a better way, but this will do the trick...

Code: Select all
$original="YYYYMMDDHHMMSS";
$new=substr_replace($original, '-', 4, 0);
$new=substr_replace($new, '-', 7, 0);
$new=substr_replace($new, '-', 10, 0);
$new=substr_replace($new, '-', 13, 0);
$new=substr_replace($new, '-', 16, 0);
sarah
New php-forum User
New php-forum User
 
Posts: 4
Joined: Fri Jan 10, 2003 8:11 am


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron