Radek Zajkowski <mailto:[EMAIL PROTECTED]>
on Monday, May 17, 2004 12:38 PM said:
> $module_dir = ($module == "")
> ? ""
> : $module."/";
>
> what does the semicolon and the question mark do?
<?php
if ($module == "")
{
$module_dir = "";
}
else
{
$module_dir = $module."/";
}
?>
i think it's called a ternary operator. usually i write it all on one
line like so:
<?php
$module_dir = ($module == "") ? "" : $module."/" ;
?>
hth!
chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php