i have a variable, and i want to be able to take a 4 digit number and insted of having it show up as... XXXX i want it to show up as XX:XX is there a way i can do this and the variable to equal that new form? this is for php.
Printable View
i have a variable, and i want to be able to take a 4 digit number and insted of having it show up as... XXXX i want it to show up as XX:XX is there a way i can do this and the variable to equal that new form? this is for php.
Not quite sure what you mean by:
"is there a way i can do this and the variable to equal that new form?"
Anyways, here's my guess:
Not sure if you can put all of the $newvar on the same line, but I dont see why not.PHP Code:$var = XXXX;
$newvar = substr($var, 0, 2) . ':' . substr($var, 2, 4);
oh sweet you knew exactly what i was talking about. thank you very much