Current location: Hot Scripts Forums » Programming Languages » PHP » Variable within a variable


Variable within a variable

Reply
  #1 (permalink)  
Old 03-17-10, 11:36 AM
cedricmeier12345 cedricmeier12345 is offline
New Member
 
Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Variable within a variable

Hello i have the 2 following arrays that contain a variable ($category) inside the array. I can't seem to get the variable ($category) that is inside the array to show what the variable is set to. Does anyone have any ideas?
Thanks so much


$files1 = array('http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/$category/$category_p1_1/logs/'.$dateeveryday."_raw",
'http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/$category/$category_p1_2/logs/'.$dateeveryday."_raw",
'http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/$category/$category_p1_3/logs/'.$dateeveryday."_raw");



$files = array('http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/.$category./.$category._p1_1/logs/alltotal_raw', 'http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/.$category./.$category._p1_2/logs/alltotal_raw',
'http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/.$category./.$category._p1_3/logs/alltotal_raw');
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-17-10, 01:34 PM
az88 az88 is offline
Newbie Coder
 
Join Date: Feb 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
If you are doing what I think you are then you could use variable variables:

PHP: Variable variables - Manual
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-17-10, 01:58 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
'http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/.$category./.$category._p1_1/logs/alltotal_raw'

Use double quotes

"'http://www.domain.com/admin/administrators/canada/bc/delta/tsa_ferries/call_counters/.$category./.$category._p1_1/logs/alltotal_raw"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
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
Reassign a variable, linked to a class, from within the same class Ryan75 PHP 2 04-28-09 12:30 AM
getting a variable to display another variable? frobak PHP 2 03-17-09 04:23 PM
Reading XML anupamsr PHP 13 04-19-08 01:57 PM
templating problem (how to forward file name as a variable) skyrat PHP 0 09-11-05 09:27 PM
using variable variables with multiple variables for parts of the name harlock PHP 7 07-26-05 08:35 PM


All times are GMT -5. The time now is 12:56 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.