The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Really Basic Question about PHP includes
Note: No scripting is being run using includes by myself, nor anyone else. This is on including plain HTML files, not programs/scripts/etc.
What is the difference between all these ways of writing includes? On W3Schools, they use this code: Code:
<?php include("menu.php"); ?> Code:
include 'vars.php'; Code:
<?php include "menu.php"; ?> The second thing is this. Why do many books go back on what they say about security and Super Globals in later examples? |
#2
|
|||
|
|||
These are all valid, but the prefered syntax is:
include("filename"); |
#3
|
||||
|
||||
The <?php and ?> tags specify the start and end of where PHP should start processing code.
|
#4
|
|||
|
|||
Quote:
Oh I and prefer using single quotes inside brackets...it looks far clean then double quotes. include('file.php'); |
#5
|
||||
|
||||
Single quotes when not parsing variables, double when.
|
#6
|
|||
|
|||
In that case I prefer to leave the single quotes, stick in the variable then re-open them. Shows up far better under syntax highlighting too. require_once('functions_'. $file .'.php');
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|