what is missing in dis small code????

Started on the old forum in June 2011 · view the original in the archive · old links redirect here

3 replies · 440 views · started 15 years ago · 1 min read

4 participants
nimeshka Developer · 180 posts #2

slowy wrote:

else if
$show = $mob1;
else 
$show = $mob2;
return $show;  

its giving me error

Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /home/abcd/public_html/index.php on line 25

What is the condition you try by putting else if ? I dont know....but this will work

else if(your condition){
$show = $mob1;
}else{
$show = $mob2;
}
return $show;  

External image (may be gone)

I'm Proud to be a Sri Lankan!

ReazulIqbal Developer · 103 posts #3

Try like this

elseif($condition) {
$show = $mob1;
}
else {
$show = $mob2;
}
return $show;
arpan.rnc Developer · 94 posts #4

slowy wrote:

else if
$show = $mob1;
else 
$show = $mob2;
return $show;  

its giving me error

Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /home/abcd/public_html/index.php on line 25

your condition is missing from the else if try this :

else if (<condition>)
$show = $mob1; 
else  
$show = $mob2; 
return $show;

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close