Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($dragon_breed != '')
- {
- // First, let's see what $dragon_breed contains
- var_dump($dragon_breed);
- echo "<BR>";
- // That displayed the ID of the breed. Now let's get the name of the breed.
- $breedid = $dragon_breed;
- $breeddata = new Pod('breeds', $breedid);
- echo 'Breed: ' . $breeddata->display('name') . "<BR>";
- // Name of the breed is being displayed, now let's get the name of the artist with a simple display
- echo 'Artist name: ' . $breeddata->display('artist') . "<BR>";
- // With the above I will be screwed once I enter the link part, so let's test in another way: First get field then echo the $
- $dragon_artist = $breeddata->get_field('artist');
- echo 'Artist name: ' . $dragon_artist . "<BR>";
- // This gives an array. Now let's see if we can get the artist id from this array. First let's get the $key and $value and see what those are.
- if ($dragon_artist != '')
- {
- var_dump($dragon_artist);
- echo "<BR>";
- if (is_array($dragon_artist))
- {
- foreach ($dragon_artist as $key => $value)
- {
- echo 'Key: ' . $key . ' Value: ' . $value . "<BR>";
- }
- } else if (!is_array($dragon_artist))
- {
- echo $dragon_artist;
- echo "<BR>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement