# Gallery php instead of xml

**URL:** <https://forum.kirupa.com/t/gallery-php-instead-of-xml/222553>\
**Category:** Uncategorized\
**Created:** [April 14, 2007, 6:09pm UTC](https://forum.kirupa.com/t/gallery-php-instead-of-xml/222553 "2007-04-14T18:09:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigSerb](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@BigSerb](https://forum.kirupa.com/u/BigSerb)\
**Post date:** [April 14, 2007, 6:09pm UTC](https://forum.kirupa.com/t/gallery-php-instead-of-xml/222553/1 "2007-04-14T18:09:38Z")

</div>

The gallery below uses XML, but I want to modify it to use PHP. I have included a PHP script that I want to incorporate, which just returns image URL’s. How would I modify this to work with PHP, and specifically the script I have included. Thanks in advance.

```auto

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
    //portfolioTag = this.firstChild;
    numimages = this.firstChild.childNodes.length;
    spacing = 70;
    for (i=0; i<numimages; i++) {
        this.picHolder = this.firstChild.childNodes*;
        this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
        this.thumbHolder._x = i*spacing;
        this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
        this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
        this.thumbHolder.title = this.picHolder.attributes.title;
        this.thumbHolder.main = this.picHolder.attributes.main;
        this.thumbHolder.onRelease = function() {
            loader.loadMovie(this.main);
            title_txt.text = this.title;
        };
    }
};
myPhoto.load("xmlphoto.xml");

```

```php

 <?php 

$userids = array('12345678', '76543210', '98765432'); // all userids go in here 
for($i=0; $i<sizeof($userids); $i++){ 
  displayImage($userids[$i], $i); 
} 

function displayImage($id, $img_count){ 
  $u= "http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=$id"; 

  $t = join("",file("$u")); 

  $r = '/ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" .*?"><img src="(.*?)"/'; 

  $t = ereg_replace("
", "", $t); 

  preg_match_all($r, $t, $m); 

  $img=$m[1][0]; 

  echo ("&myImage".$img_count."=".$img);   
}   

?>  

```
