note 115827 added to function.include

From: Date: Tue, 30 Sep 2014 23:05:31 +0000
Subject: note 115827 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-200551@lists.php.net to get a copy of this message
It's worth noting that PHP provides an OS-context aware constant called DIRECTORY_SEPARATOR. If you use that instead of slashes in your directory paths your scripts will be correct whether you use *NIX or (shudder) Windows. (In a semi-related way, there is a smart end-of-line character, PHP_EOL) Example: <?php $cfg_path = 'includes' . DIRECTORY_SEPARATOR . 'config.php' ; require_once($cfg_path); ---- Server IP: 216.194.115.244 Probable Submitter: 98.169.66.145 ---- Manual Page -- http://php.net/manual/en/function.include.php Edit -- https://master.php.net/note/edit/115827 Del: integrated -- https://master.php.net/note/delete/115827/integrated Del: useless -- https://master.php.net/note/delete/115827/useless Del: bad code -- https://master.php.net/note/delete/115827/bad+code Del: spam -- https://master.php.net/note/delete/115827/spam Del: non-english -- https://master.php.net/note/delete/115827/non-english Del: in docs -- https://master.php.net/note/delete/115827/in+docs Del: other reasons-- https://master.php.net/note/delete/115827 Reject -- https://master.php.net/note/reject/115827 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200551) next »