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 Link to comment https://forums.phpfreaks.com/topic/237052-simple-array-problem/ 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. Link to comment https://forums.phpfreaks.com/topic/237052-simple-array-problem/#findComment-1218450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.