Jump to content

Conditional Includes?


parboy

Recommended Posts

I want to use a conditional statement to determine which include should be used based on whether the statement evaluates true or false. I think it's a matter of syntax but I haven't figured out the correct form. It seems to get more complicated with variables inside the includes.

 

Example:

 

<? if($issue_number=="n") {
echo "<?php include 'issues/'."$nl_issue[$nl-1]".'.php'; ?>";
} else {
echo <?php include 'issues/'."$nl_issue[$issue_number]".'.php'; ?>";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/202690-conditional-includes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.