Click here to Skip to main content
15,917,862 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
PHP
elseif((($staff->Floor) == "3") && (($staff->Block) == "A2" || A3))
				{
					echo '<a href="'.base_url().'kiosk/main_gallery'.'" id="btnfind">Find Me Here</a> ';
				}

i can't get the
PHP
$staff->Block
compare string.

[Edit: fix markup]
Posted
Updated 10-Dec-15 6:36am
v2
Comments
Sergey Alexandrovich Kryukov 9-Dec-15 22:08pm    
Not clear.
—SA

1 solution

Observation 1:
elseif

implies that there is a
if

statement above and there is an
else

for the last condition.

Observation 2:
The parentheses are not properly paired. Pair them properly accordingly to the conditions your desire.

An example to help you figure it out:
<?php
 
 
class Staff
{
  public $Floor;
  public $Block;
}

$staff = new Staff;
$staff->Floor = "3";
$staff->Block = "A3";

if (1==2)
{
	echo 'this will never happen';
}
elseif(($staff->Floor == "3") && (($staff->Block == "A2") || ($staff->Block == "A3")))
{
    echo 'Find Me Here ';
} 
else 
{
    echo 'None of the above ';	
}

?>
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900