Skip to content

Instantly share code, notes, and snippets.

@RSquaredSoftware
Created April 13, 2012 07:05
Show Gist options
  • Save RSquaredSoftware/2374675 to your computer and use it in GitHub Desktop.
Save RSquaredSoftware/2374675 to your computer and use it in GitHub Desktop.
$state=array('song'=>'FALSE', 'artist'=>'FALSE', 'votes'=>'FALSE');
$order = 'song';
if (isset($_GET['order'])){
$order = $_GET['order'];
echo $state[$order]." ";
$state[$order] = ! $state[$order];
echo $state[$order]." ";
}
if($state[$order])
$sort = 'DESC';
else
$sort = 'ASC';
echo $sort;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment