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. Quote 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. Quote 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. Quote 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... Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.