# PHP Help

**URL:** <https://forum.kirupa.com/t/php-help/210343>\
**Category:** Uncategorized\
**Created:** [December 18, 2006, 12:23am UTC](https://forum.kirupa.com/t/php-help/210343 "2006-12-18T00:23:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth\_aldridge](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@seth\_aldridge](https://forum.kirupa.com/u/seth_aldridge)\
**Post date:** [December 18, 2006, 12:23am UTC](https://forum.kirupa.com/t/php-help/210343/1 "2006-12-18T00:23:15Z")

</div>

I have this script that is running and displaying random images in order, but it is listing them all out rather than just one. I need to know how to limit it to just 1.

```php

<?php
     $content = array(
          'http://www.address1.com|marketing|RE-volve Media Marketing Image',
          'http://www.address2.com|search_marketing|RE-volve Media Search Marketing Image',
          'http://www.address3.com|web_development|RE-volve Media Web Development Image',
     );

     shuffle($content);
                
     foreach ($content as $value)
     {
          $explode = explode('|', $value);
          echo '<a href="' . $explode[0] . '"><img src="assets/headers/' . $explode[1] . '.gif" alt="' . $explode[2] . '" title="' . $explode[2] . '"></a>';
     }
?>

```
