Hi Rob if(isset($_POST['submit'])) { $position= $_POST['t1'] ; $file= $_POST['t2']; here t1 is the new postion of where to chage the element t2: is the file name; EX: in the bleow xml 4.jpg is at second position. here i want to change it to first position. so i will give in t1 values as 1 the filename as 4.jpg. now we need to get 4.jpg is in first position. and the element in first positon need to getdown to nex to 4.jpg <gallery> <item> <thumb>2.jpg</thumb> <img>2.jpg</img> </item> <item> <thumb>3.jpg</thumb> <img>3.jpg</img> </item> <item> <thumb>4.jpg</thumb> <img>4.jpg</img> </item> <item> <thumb>5.jpg</thumb> <img>5.jpg</img> </item> </gallery> On Thu, May 1, 2008 at 1:29 PM, Atkinson, Robert <ratkinson@xxxxxxxxxxxxx> wrote: > But you still haven't said what order you need the array in? > > > Rob. > > -----Original Message----- > From: php-objects@xxxxxxxxxxxxxxx <php-objects%40yahoogroups.com> [mailto: > php-objects@xxxxxxxxxxxxxxx <php-objects%40yahoogroups.com>] On > Behalf Of srinivas pmm > Sent: 01 May 2008 05:24 > To: php-objects@xxxxxxxxxxxxxxx <php-objects%40yahoogroups.com> > Subject: Re: how to chnage the elements positons in array > > Hi Rob > Thanx for your resonse. > we have an arrray > > <gallery> > <item> > <thumb>2.jpg</thumb> > <img>2.jpg</img> > </item> > > <item> > > > *********************************************************************************** > Any opinions expressed in email are those of the individual and not > necessarily those of the company. This email and any files transmitted with > it are confidential and solely for the use of the intended recipient > or entity to whom they are addressed. It may contain material protected by > attorney-client privilege. If you are not the intended recipient, or a > person responsible for delivering to the intended recipient, be advised that > you have received this email in error and that any use is strictly > prohibited. > > Random House Group + 44 (0) 20 7840 8400 > http://www.randomhouse.co.uk > http://www.booksattransworld.co.uk > http://www.kidsatrandomhouse.co.uk > Generic email address - enquiries@xxxxxxxxxxxxxxxxx<enquiries%40randomhouse.co.uk> > > Name & Registered Office: > THE RANDOM HOUSE GROUP LIMITED > 20 VAUXHALL BRIDGE ROAD > LONDON > SW1V 2SA > Random House Group Ltd is registered in the United Kingdom with company > No. 00954009, VAT number 102838980 > > *********************************************************************************** > > > -- Regards P.M.M.Srinivas [Non-text portions of this message have been removed]