+ 2

How do you separate your php code with html code?

Should I do this? <?php if ($is_admin): ?> <?php include 'navigation-admin.php'; ?> <!-- html code --> <?php endif; ?> Or this? <?php if ($is_admin): include 'navigation-admin.php'; ?> <!-- html code --> <?php endif; ?>

8th Dec 2016, 4:17 PM
Gilbert Lacasandile
Gilbert Lacasandile - avatar
1 Antwort
+ 1
in html u could add your code of php in the body tag while the better way is to include or require the .php file
8th Dec 2016, 7:16 PM
Owais Khan
Owais Khan - avatar