Is there any way in php to define a variable like...
$content = if ($user['adminLevel'] > 0) echo '<p>YAY IT WORKS</p>';
And when you echo the variable it will perform the if statement?
Is there any way in php to define a variable like...
$content = if ($user['adminLevel'] > 0) echo '<p>YAY IT WORKS</p>';
And when you echo the variable it will perform the if statement?
How about just writing a function? Then instead of "echoing the variable", just call the function.
function content() {
global $user;
if ($user['adminLevel'] > 0) {
echo '<p>YAY IT WORKS</p>';
}
}
// and then later on...
content();