$schemamarkup = get_post_meta(get_the_ID(), 'schemamarkup', true); if(!empty($schemamarkup)) { echo $schemamarkup; }

PHP How to Check If A Key Exists in Associative Array

October 20, 2011 | By Duchateaux.

PHP 5 Check if Key Exist in Assoc Array

If you have an Array $kvarray of Pairs Key-Value and the Key is stored in the $key Variable you Check if it’s present in the Array’s Index by the function:

array_key_exists($key, $kvarray)