PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Ofta
Forum Newbie
Posts: 3 Joined: Tue Apr 17, 2007 5:58 am
Post
by Ofta » Fri Jan 11, 2008 10:08 am
Hey!
I need to call a function from the inside of an If-segment and it doesnt seem to work.
Code: Select all
function A() { echo 'Hey'; }
if (!isset($B)) { '.A().' }
Can anyone help me?
Oren
DevNet Resident
Posts: 1640 Joined: Fri Apr 07, 2006 5:13 am
Location: Israel
Post
by Oren » Fri Jan 11, 2008 11:01 am
Jonah Bron
DevNet Master
Posts: 2764 Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California
Post
by Jonah Bron » Fri Jan 11, 2008 2:16 pm
Code: Select all
<?php
function A(){
return 'Hey';
}
if (!isset($B)) echo A();
?>