Current location: Hot Scripts Forums » Programming Languages » PHP » how to concatenate "\" with the contents of variable.


how to concatenate "\" with the contents of variable.

Reply
  #1 (permalink)  
Old 05-10-09, 11:23 AM
umarmir_123 umarmir_123 is offline
Newbie Coder
 
Join Date: May 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
how to concatenate "\" with the contents of variable.

hi everybody,

i want to concatenate the contents of variable with \ .
$path= "C:\apache\htdocs\IMS\files";
$id="human";
i want to store the contents of $path ,$id and "_xyz.txt" into another variable say $temp
my output should be like this
$temp=" C:\apache\htdocs\IMS\files\human_xyz.txt";
thnx in advance..
Reply With Quote
  #2 (permalink)  
Old 05-10-09, 11:30 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
PHP Code:

$temp "{$path}\{$id}_xyz.txt"
... or:
PHP Code:

$temp sprintf('%s\%s_xyz.txt'$path$id); 

Reply With Quote
  #3 (permalink)  
Old 05-11-09, 09:02 PM
umarmir_123 umarmir_123 is offline
Newbie Coder
 
Join Date: May 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
thanx nico.. it realy works.
i am having another problem. i recieve this error message
Fatal error: Maximum execution time of 30 seconds exceeded in c:\apache\htdocs\ims\process.php on line 41


at line 41 i have this code
while(!feof($fptr_id))
so plz tell me what is wrong in this statement..
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
getting a variable to display another variable? frobak PHP 2 03-17-09 03:23 PM
Reading XML anupamsr PHP 13 04-19-08 12:57 PM
Variable Variables lkegley9 Flash & ActionScript 1 08-18-07 11:42 PM
templating problem (how to forward file name as a variable) skyrat PHP 0 09-11-05 08:27 PM
using variable variables with multiple variables for parts of the name harlock PHP 7 07-26-05 07:35 PM


All times are GMT -5. The time now is 08:35 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.