Last active
December 16, 2016 14:06
-
-
Save nickdavis/609558092a63c505e791cfb40663f00d to your computer and use it in GitHub Desktop.
Unserialize array in PHP (from Advanced Custom Fields PRO, in this example)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get one value from an serialized array example | |
* | |
* @link http://stackoverflow.com/questions/8192789/getting-one-value-out-of-a-serialized-array-in-php#8192803 | |
* | |
* @author Nick Davis | |
* | |
* @return array | |
*/ | |
function nd_unserialise_array_acf_example( $location ) { | |
$map = unserialize( get_term_meta( $location->term_id, 'ta_location_map', true ); ); | |
return $map; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment