Find the answer to your Linux question:
Results 1 to 2 of 2
I have XAMPP the 1.6.6 version. The trouble is that the boolean value of 1 is displayed but 0 is not. For example: Code: <?php $raw = 18; $result = ...
  1. #1
    Linux User
    Join Date
    Jun 2007
    Posts
    458

    Bool 0 not displayed PHP

    I have XAMPP the 1.6.6 version. The trouble is that the boolean value of 1 is displayed but 0 is not. For example:

    Code:
    <?php 
    $raw = 18;
    $result = ( $raw == 18 );
    echo $result;
    ?>
    then the value 1 is displayed but:

    Code:
    <?php 
    $raw = 17;
    $result = ( $raw == 18 );
    echo $result;
    ?>
    then 0 is not displayed! What to do?
    "When you have nothing to say, say nothing."

  2. #2
    Just Joined! geniuz's Avatar
    Join Date
    Mar 2008
    Location
    Netherlands, Europe
    Posts
    71
    I don't exactly understand what you're trying to do...
    but this looks kinda awkward, its like saying 1 = 2 o_O...
    if you want a logical way and output try this :

    <?php

    $raw = 18;

    if( $raw == 18 )
    {
    $result = 1;
    echo $result;
    }
    else
    {
    $result = 0;
    echo $result;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...