marc6678 Posted February 13, 2013 Share Posted February 13, 2013 Hi guys, I am trying to join this text ..\ and the variable $filepath. Both are text but whatever I do there is an error thrown. Its so that I can go back a directory when using the file path stored in the variable $filepath. Thanks, Marc Link to comment https://forums.phpfreaks.com/topic/274459-joining-string-and-variable/ Share on other sites More sharing options...
Jessica Posted February 13, 2013 Share Posted February 13, 2013 You probably want / Regardless we need to see your code. Link to comment https://forums.phpfreaks.com/topic/274459-joining-string-and-variable/#findComment-1412326 Share on other sites More sharing options...
marc6678 Posted February 13, 2013 Author Share Posted February 13, 2013 This is the code I currently have, for some reason the board wont let me enter a new line but hey... echo "..\$parturl"; its to go back a directory and into the folder media/images/gallery so $parturl stores that plus the exact file name so I need to add ..\ to the front of media/images/gallery/img1.png for example which is gathered from a field in a database Link to comment https://forums.phpfreaks.com/topic/274459-joining-string-and-variable/#findComment-1412329 Share on other sites More sharing options...
Jessica Posted February 13, 2013 Share Posted February 13, 2013 The \ is trying to escape the $ You want the other slash, regardless. See all your other slashes go that way?? Link to comment https://forums.phpfreaks.com/topic/274459-joining-string-and-variable/#findComment-1412331 Share on other sites More sharing options...
marc6678 Posted February 13, 2013 Author Share Posted February 13, 2013 The \ is trying to escape the $ You want the other slash, regardless. See all your other slashes go that way?? Hi yes, I see that however I thought for going backward the backslash was needed? Link to comment https://forums.phpfreaks.com/topic/274459-joining-string-and-variable/#findComment-1412334 Share on other sites More sharing options...
DavidAM Posted February 14, 2013 Share Posted February 14, 2013 Since M? W?????? is the only operating system that uses the backslash, I guess that says it all! Link to comment https://forums.phpfreaks.com/topic/274459-joining-string-and-variable/#findComment-1412368 Share on other sites More sharing options...
Barand Posted February 14, 2013 Share Posted February 14, 2013 I guess it's a throwback to its CP/M ancestry. Link to comment https://forums.phpfreaks.com/topic/274459-joining-string-and-variable/#findComment-1412417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.