eregi_replace()

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf


sarah
New php-forum User
New php-forum User
Posts: 4
Joined: Fri Jan 10, 2003 8:11 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);


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests

cron