From: [EMAIL PROTECTED] Operating system: All PHP version: 4.1.2 PHP Bug Type: Feature/Change Request Bug description: Swapping two elements of an array
I must be getting old, but I cannot seem to find a function that swaps the data of two array entries. Like so: $ar[0] = "second"; $ar[1] = "first"; array_swap ($ar, 0, 1); I have not overlooked the sort functions, that is not what I am after. But I may have overlooked other possibilities. Searching for "swap" in the PHP .CHM (fairly recent) yielded no hits. -- Edit bug report at http://bugs.php.net/?id=16119&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16119&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16119&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16119&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16119&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16119&r=support Expected behavior: http://bugs.php.net/fix.php?id=16119&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16119&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16119&r=submittedtwice