CodeIgniter Forums
Pulling One item from an Array - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: Pulling One item from an Array (/showthread.php?tid=72584)



Pulling One item from an Array - VK4JE - 01-08-2019

Hi,
I am wishing to 'Pull' the "name_surname" into an email.

When I use <?php echo json_encode($user); ?>

I get the output below

{"id":"250","username":"marion-test","password":"b7cc81807a","name_surname":"Marion Testing","address":"","town":null,"state":null,"description":"","phone":"","phone2":"0","mail":"[email protected]","last_login":null,"registration_date":"2019-01-07 13:49:58","type":"USER","language":"english","repository_id":"568","activated":"1","qa_id":"0","package_id":"2","package_last_payment":"2019-01-03 09:11:01","facebook_id":"","mail_verified":"0","phone_verified":"0","image_user_filename":null,"image_agency_filename":null,"company_name":null,"zip_city":null,"prename_name":null,"vat_number":null,"facebook_link":"","gplus_link":"","youtube_link":"","twitter_link":"","linkedin_link":"","county_affiliate_values":"0","embed_video_code":"","payment_details":"","custom_fields":"[]","research_sms_notifications":"0","research_mail_notifications":"0","agency_id":"0","last_edit_ip":"172.193.22.238"} 

When I use <?php echo $name_surname; ?> I do not get any output

Would be grateful for some guidance please.


RE: Pulling One item from an Array - Wouter60 - 01-09-2019

PHP Code:
<?= $user['name_surname'];?>

<?= is short for <?php echo


RE: Pulling One item from an Array - VK4JE - 01-09-2019

(01-09-2019, 12:23 AM)Wouter60 Wrote:
PHP Code:
<?= $user['name_surname'];?>

<?= is short for <?php echo

Thank you,
Works Perfectly 
Cheers
Ron