Jump to content

noobie question about variable types.


joyser

Recommended Posts

hmm, so, are you sure if you echo $hours and $time_change they will be simple numbers

Because if they are simple numbers, then, i think there should be no problem

 

Perhaps you need to show the whole script from start to end for better help

I read the PHP Manual for substr, this is what I understand. Straight from PHP.net.

http://us3.php.net/substr

 

string substr  ( string $string  , int $start  [, int $length  ] )

Returns the portion of string  specified by the start  and length  parameters.

 

$rest = substr("abcdef", -3, 1); // returns "d"

It basically starts between c and d and counts 1.

 

$timestamp = 2/22/09

$hours = substr($timestamp, 3, 2);

$hours = $hours - $time_change;

echo $hours;

 

It will print: 2/

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.