I am having trouble trying to echo each iteration of a particular part of an array.
Here are the clues. I can't quite piece them together (since I don't yet know much about php arrays).
If I do the following:
<?php
$audiofile = simple_fields_value("audiofile");
echo $audiofile['url'];
?>
I get the URL of the file, which is what I want. However, I have four different URL's (A "two-dimensional array", I believe?), and I want to echo each of them.
According to the Simple Fields documentation, I know that I need to change the second line to:
$audiofile = simple_fields_values("audiofile");
This leads me to change the php as follows:
<?php
$audiofile = simple_fields_values("audiofile");
for($i=0;$i<count($audiofile);$i++)
{
echo $audiofile[$i];
}
?>
But this only echoes "ArrayArrayArrayArray".
Which makes sense, because $audiofile is returning an array of info, FROM WHICH I only want the ['url'].
So, I tried the following:
<?php
$audiofile = simple_fields_values("audiofile");
for($i=0;$i<count($audiofile);$i++)
{
echo $audiofile['url'][$i];
}
?>
But that echoes null.
Any ideas?
echousevar_dump($audiofile[$i]);