I have an array:
array( 0 => \'contact\', 1 => \'home\', 2 => \'projects\' );
and I need to swap the \'contact\' with
Try this:
$a = array( 0 => 'contact', 1 => 'home', 2 => 'projects' ); $temp = $a[0]; $a[0] = $a[1]; $a[1] = $temp;