Page 1 of 1

Calling a function outside of If-segment

Posted: Fri Jan 11, 2008 10:08 am
by Ofta
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? :(

Re: Calling a function outside of If-segment

Posted: Fri Jan 11, 2008 11:01 am
by Oren

Code: Select all

if (!isset($B)) A();  

Re: Calling a function outside of If-segment

Posted: Fri Jan 11, 2008 2:16 pm
by Jonah Bron

Code: Select all

<?php
function A(){
  return 'Hey';
}
if (!isset($B)) echo A();
?>