PHP - How does the `require_once` construct executes the code?

68 Views Asked by At

I am wondering which one of the following is a better approach when I call require_once(file.php):

file.php

<?php
    $name = "Three";
    echo "<h1> Header Tag : $name </h1>";
?>

OR

file.php

<?php
   $name = "Three";
?>

<h1> Header Tag : <?=$name?> </h1>

I'm curious to know if using either one of these could cause any sort of problem down the road in execution.

0

There are 0 best solutions below