aspose file tools*
The moose likes PHP and the fly likes Confusing slashes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "Confusing slashes" Watch "Confusing slashes" New topic
Author

Confusing slashes

egbai mmumene
Ranch Hand

Joined: Sep 18, 2012
Posts: 43
I'm trying to set a directory on a php page but the book i'm using uses the back slash"/" instead of the front slash"\" although both aren't working in displaying my image
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

backslash = \
forward slash = /

Backslash is only used on Windows.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 71

I usually use forward slashes (/) in file patchs because backwards slashes (\) are treated as escaped characters in PHP (and Java) strings and thus can lead to surprising results.

Of course, this doesn't solve the problem you are having. To solve that problem, change your file references to use the correct relative path. If you need more help than that, please post the code you are using, and also post the exact location of the file you are attempting to access (full path location for both the PHP file containing the code and the file being referenced, please).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confusing slashes