jd2007 Posted August 2, 2007 Share Posted August 2, 2007 <?php $timea="<script> var d = new Date() document.write(d.getTime());</script><br><br>"; echo $timea."<br>"; $timeb="<script>var e = Date.UTC(2006,7,8,11,30,24) document.write(e);</script>"; echo $timeb."<br>"; echo $timeb - $timea; ?> this : echo $timeb - $timea; ...i get output 0. Link to comment https://forums.phpfreaks.com/topic/63048-why-does-my-script-output-wrong-results/ Share on other sites More sharing options...
sKunKbad Posted August 2, 2007 Share Posted August 2, 2007 When php interprets your code, it doesn't do javascript. Javascript is done on your browser. Link to comment https://forums.phpfreaks.com/topic/63048-why-does-my-script-output-wrong-results/#findComment-314010 Share on other sites More sharing options...
jd2007 Posted August 2, 2007 Author Share Posted August 2, 2007 i did not put php in javascript...i put javascript into php. Link to comment https://forums.phpfreaks.com/topic/63048-why-does-my-script-output-wrong-results/#findComment-314015 Share on other sites More sharing options...
jd2007 Posted August 2, 2007 Author Share Posted August 2, 2007 i solved it... Link to comment https://forums.phpfreaks.com/topic/63048-why-does-my-script-output-wrong-results/#findComment-314022 Share on other sites More sharing options...
zq29 Posted August 2, 2007 Share Posted August 2, 2007 You can't perform mathematic equations on strings. Link to comment https://forums.phpfreaks.com/topic/63048-why-does-my-script-output-wrong-results/#findComment-314026 Share on other sites More sharing options...
jd2007 Posted August 7, 2007 Author Share Posted August 7, 2007 i know Link to comment https://forums.phpfreaks.com/topic/63048-why-does-my-script-output-wrong-results/#findComment-317119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.