Why doesn't this work?
From: ScareCrowe (nospam_at_nospam.com)
Date: 07/25/04
- Next message: ScareCrowe: "Re: How to use excel file in sql table"
- Previous message: steve: "Re: Re: How to make a timeline in PHP?"
- Next in thread: ScareCrowe: "Re: Why doesn't this work?"
- Reply: ScareCrowe: "Re: Why doesn't this work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 24 Jul 2004 22:49:45 -0500
I am trying to format a date that is grabbed from a class that returns a
timestamp. I can echo the variable and it prints correctly but if I pass it
to the date function it doesn't. I figured out that the number is passed
from the class as a string and not an integer. I thought I could just set
the type to integer and it would work, but it doesn't. I'm a little confused
because it really seems like I am saying the same thing both times but PHP
disagrees. Is there something I am missing here?
Thanks,
--ScareCrowe
Here is the script:
<?
$thistime=$abc->timeStats("StartTime");// This would return '980126114' as a
string, value is from remote XML parsed with eregi (just FYI)
echo $thistime." => ".gettype($thistime)."<br>\n"; //show the var type
settype($thistime, "integer");//change var to integer
echo $thistime." => ".gettype($thistime)."<br>\n";//show the var type
?>
returns:
980126114 => string
0 => integer
<?
$thistime="980126114";// here the value is explicit
echo $thistime." => ".gettype($thistime)."<br>\n";//show the var type
settype($thistime, "integer");//change var to integer
echo $thistime." => ".gettype($thistime)."<br>\n";//show the var type
?>
returns:
980126114 => string
980126114 => integer
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
- Next message: ScareCrowe: "Re: How to use excel file in sql table"
- Previous message: steve: "Re: Re: How to make a timeline in PHP?"
- Next in thread: ScareCrowe: "Re: Why doesn't this work?"
- Reply: ScareCrowe: "Re: Why doesn't this work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|