Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: strange problem

  1. #1
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts

    strange problem

    i got this for my array
    Code:
    Array ( [0] => 1.00 [1] => [2] => 1.00 )
    however
    when i do
    Code:
    for($i=0;$i<count($ppart);$i++){
    	if(empty($ppart[$i])){
    		echo "<br/>";
    	}else{
    		echo "\$".$ppart[$i]."<br/>";
    	}
    }
    The output continuesly to have "$" for $ppart[1] instead of "<br/>"
    where is the problem
    thanks
    flying dagger

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    these are what you are trying to match:
    Code:
    "" (an empty string)
    0 (0 as an integer)
    "0" (0 as a string)
    NULL
    FALSE
    array() (an empty array)
    var $var;
    if you run this, what do you get:
    Code:
    var_dump($ppart[1]);

  • #3
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts
    string(1) " "
    thanks
    flying dagger


  •  

    Posting Permissions

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