Opel_Corsa Posted January 3, 2007 Share Posted January 3, 2007 For the following function, how would I convert args 4,5,6 of gmmktime() into integer?[code]function _translate_date_format( $date_str, $hour, $min ){ global $js_date_trans; $date_split = list ( $part[0], $part[1], $part[2]) = split ('[/.-]', $date_str ); $stamp = gmmktime( $hour, $min, 0, $part[ $js_date_trans["%m"] ], $part[ $js_date_trans["%d"] ], $part[ $js_date_trans["%Y"] ] ); return $stamp;}[/code]In our system's log file there're several errors of the form below:[quote]27-Dec-2006 12:43:16] PHP Warning: gmmktime() expects parameter 6 to be long, string given in xxxxx.php on line x[/quote]The writer of the script is not accessible and we're wondering how we could patch this php file up.Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/32640-gmmktime-arguments/ Share on other sites More sharing options...
Jessica Posted January 3, 2007 Share Posted January 3, 2007 to get the interget value of something use intval();But, since PHP uses weak typing, I would think it would only give that error if there was no value at all, or a value which was not a number. intval on a string produces 0, so I don't think that will help.Could you try adding print_r($js_date_trans);to make sure all the values are set? Link to comment https://forums.phpfreaks.com/topic/32640-gmmktime-arguments/#findComment-151887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.