Tell me how include and require are different from each other?
Answer Posted / Sachin Dev Verma
Both include() and require() in PHP are used to load external files, but they have some differences:n1. Include: It creates a new execution scope for the included file, meaning variables defined in the included file can be accessed outside of it.n2. Require: It creates a new execution scope as well, but it also produces an error and stops script execution if the specified file cannot be found.n3. Eval(): Unlike include() and require(), eval() evaluates PHP code inside the string.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers