I have a variable $time in the format 12:45:00. What I am wondering is how I would go about stripping everything before the first colon and assigning it to the variable $hour and removing everything before the second colon and assigning it to the variable $minutes. I think I would use ereg_replace or something like that.
thanks
Well there are several ways of doing this, but the easiest (unless Vincent can top me again🙂 is probably:
$time = "12:45:00"; list($hour,$minute,$second) = explode(":", $time);
HTH.
-geoff