Jump to content

Simple array problem?


grahamb314

Recommended Posts

I'm trying to learn arrays and I have this problem:

 

I have a variable $a which is a result from a  from a database query

 

If I echo it I get:

forenamesurnamedate_of_birthgenderpaypal_addresspayment_planaddress_line_1address_line_2address_cityaddress_zip_post_codeaddress_countrytelephonemobilewhere_did_you_hearreceive_newsletter 

If I var_dump($a) I get:

string( "forename" string(7) "surname" string(13) "date_of_birth" string(6) "gender" string(14) "paypal_address" string(12) "payment_plan" string(14) "address_line_1" string(14) "address_line_2" string(12) "address_city" string(21) "address_zip_post_code" string(15) "address_country" string(9) "telephone" string(6) "mobile" string(18) "where_did_you_hear" string(18) "receive_newsletter" 

 

My question is, how do I get each value from a? It looks like an array to me because it holds multiple strings. I need to get the first, second and third elements printed on the page and used in other areas of my program.

 

Thanks in advance

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.