Jump to content

Recommended Posts

Please point out what you think I may be missing. I've been staring at this for days and can't get it. I've added code to echo what the variables are, included below and that tells me the 2nd part of the following IF is FALSE ?? Yet the output confirms 1 ( the integer values ) does not equal 1, using variables. Sorry about the confusion. I thought 1 = 1.

  :o:-[ and ???

 

if ( $today_date >= 14 AND $work_mon_num == idate ( "m" ) )
{
?>
<script type="text/javascript">
setTimeout ( function()
{
        window.scrollTo ( 0, 270 );
    }, 2000 )
    </script>
<?php
}

echo "work_mo_num is : " . $work_mo_num . ", and is type : ( " . gettype ( $work_mo_num ) . " )<br />";
echo "today_date is : " . $today_date . ", and is type : ( " . gettype ( $work_mo_num ) . " )<br />";
echo ' m for the idate is : ' . idate ( "m" ) . ", and is type : ( " . gettype ( idate ( "m" ) ) . " )<br />";
echo "14 is : " . gettype ( 14 ) . "<br />";
echo '1st half of IF is : ';
($today_date >= 14 ) ? print 'true' : print 'false';
echo '<br />2nd half of IF is : ';
( idate ( "m" ) == $work_mon_num) ? print 'true' : print 'false';
echo "<br />";
( 1 == 1 ) ? print 'true' : print 'false';
echo '<br />Full IF returns : ';
( $today_date >= 14 AND $work_mon_num == idate ( "m" ) ) ? print 'true' : print 'false';

 

Here's the output of the code:

 

work_mo_num is : 1, and is type : ( integer )

today_date is : 26, and is type : ( integer )

m for the idate is : 1, and is type : ( integer )

14 is : integer

1st half of IF is : true

2nd half of IF is : false

Test 1 == 1 : true

Full IF returns : false

 

I'm stumped. Please help.

Link to comment
https://forums.phpfreaks.com/topic/142485-solved-why-is-1-not-equal-to-1/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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