CodeIgniter Forums

Full Version: Pulling One item from an Array
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
PHP Code:
<?= $user['name_surname'];?>

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

<?= is short for <?php echo

Thank you,
Works Perfectly 
Cheers
Ron