grahamb314 Posted May 21, 2011 Share Posted May 21, 2011 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 Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted May 21, 2011 Share Posted May 21, 2011 Post the code you're using both to generate $a, and also to generate those results. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.