View Full Version : The Infamous Dots... Help!
MrBojangle1
02-18-2003, 09:17 AM
I've not a clue what this does... The dots next to blocks etc..
For example:
require("./global.php");
What's the dot (.) do?! I see many scripts use this, in front of strings etc. For another example:
$templatesused.=',pagenav,pagenav_curpage,pagenav_ firstlink,pagenav_lastlink,pagenav_nextlink,pagena v_pagelink,pagenav_prevlink';
The dot just after $templatesused. :(
Any explanation would be appreciated. :)
Xenon
02-18-2003, 09:57 AM
hmm the first dot in the require has something to do with directorystructures, but AFAIK it's not needed.
the dot before the = means that the following string will be concatenated to the original and so works like $something += 3;
in english, the $text .= "more text" will just append "more text" to the end of whatever the variable was before
and the first one yes is for directory structure, the dot means to go up a level (i think) so ./ is go up then down a level or something like that
Sebastian
02-19-2003, 04:40 AM
actually, the dot in ./ means the same directory .. so
require ("./file.php"); is the same as require ("file.php");
its really not needed unless you are going one directory back, then you would do: require ("../file.php");
Erwin
02-19-2003, 04:48 AM
The dot after templates used, is different to the dot before a / for a directory. :) Xenon and mr_e explained them beautifully.
MrBojangle1
02-19-2003, 04:20 PM
Thanks people. I read understand now. :) So it's basically a thing that joins two commands together? ;)
Freddie Bingham
02-19-2003, 04:25 PM
We have had some situations where servers are unable to find include files if we don't specify the redundant "./"
oh, how weird, i never thought that mattered...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.