Hi all,
I am rather new to PHP, but have a fairly ok grasp of software design. My question arises from the fact that I'm getting ready to deploy some scripts etc. to my website which is hosted on a *nix type server. My home / work computer that I'm developing on is windows. My apache server is: Apache HTTP Server Version 2.2 running on my windows XP sp2 desktop. So when I port all of my php code over, do I have to changeall of my directory slashes from whacks to slashes when I do that?
eggmatters
21
Junior Poster in Training
Recommended Answers
Jump to PostHi EggMatters,
To make your code work on either Windows or *nix platforms, use the constant PATH_SEPARATOR in place of a slash. For example:
$stuff = file_get_contents("some_dir". PATH_SEPARATOR."another_dir". PATH_SEPARATOR.$filename);
The constant PATH_SEPARATOR represents "/" on *nix systems and "\" on Windows systems.
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.