Variable into an Array

This is a discussion on "Variable into an Array" within the PHP Forum section. This forum, and the thread "Variable into an Array are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 6th, 2006, 11:53
Junior Member
Join Date: Oct 2004
Location: Helston, Cornwal
Age: 34
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Variable into an Array

PHP: Select all

$SubjectArray = array(
    
"Pre-sales"                =>    '.$row_rs_result1['emailenq'].',
    
"Business Proposition"    =>     '.$emailenq.',
    
"Request Consultation"    =>     '.$emailenq',
    
"Other"                    =>    '$emailenq',
); 

Hello

Can i put variable into an array like I am trying, if so how do I do it?

Jamie

PS I have checked google and cannot work out how its done
Reply With Quote

  #2 (permalink)  
Old Sep 6th, 2006, 14:43
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Variable into an Array

$SubjectArray = array(
"Pre-Sales" => $row_rs_result,
"Business proposition" => $emailenq,
"Other" => $somethingelse
);

Your original had a syntax error - a comma on the line just before the ); . And I suspct you wanted the contents of the variables in the array, and not their names, so I've taken out the single quotes.
Reply With Quote
Reply

Tags
variable, array

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting a PHP array fallen_angel PHP Forum 3 Apr 20th, 2007 22:18
Top 4 array to text box buzcajun Flash & Multimedia Forum 10 Sep 14th, 2006 19:13
Sorting a new array from an existing array Ozeona Flash & Multimedia Forum 2 Sep 20th, 2005 08:43
array unable to check another array so as to be displayed Ozeona Flash & Multimedia Forum 1 Aug 5th, 2005 10:26
selecting a value from array Ozeona Flash & Multimedia Forum 2 Jul 27th, 2005 10:14


All times are GMT. The time now is 08:26.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43