We're using podpress as our podcast player, but we'd like to give the option to download the file on a page without a player. So I'm trying to figure out how to extract the URI from the metadata.
I'm new to PHP, and struggling to learn it, so I've gotten this far:
<?php
$custom_fields = get_post_custom(get_the_ID());
$my_custom_field = $custom_fields['_podPressMedia'];
foreach ( $my_custom_field as $key => $value ){
echo $key . " => " . $value . "<br />";
}
?>
which outputs
0 => a:1:{i:0;a:10:{s:3:"URI";s:85:"http://www.writingexcuses.com/wp-content/uploads/Writing_Excuses_8_1_Microcasting.mp3";s:5:"title";s:33:"Writing Excuses 8.1: Microcasting";s:4:"type";s:9:"audio_mp3";s:4:"size";i:12759440;s:8:"duration";s:5:"17:43";s:12:"previewImage";s:86:"http://legacieslost.com/writing/wp-content/plugins/podpress/images/vpreview_center.png";s:10:"dimensionW";i:0;s:10:"dimensionH";i:0;s:3:"rss";s:2:"on";s:4:"atom";s:2:"on";}}
So I can see the data I want right there, and I know I need to create another function that takes the first result and extracts just the value with the key URI, but I can't figure out what that function should look like. I haven't really figured out "array thinking" yet, despite a lot of time looking at this page on the PHP manual.
http://php.net/manual/en/control-structures.foreach.php
Any advice on construction?