If your receive this warning when programming in PHP/Joomla, it's because you're expecting a result from a query that doesn't generate one. For example,
$result = $db->loadObject();
Remove this line and the warning goes away.
If you want to accomplish essentially the same thing as a array_unique but on a multi-dimensional array
$results = array_unique($results, SORT_REGULAR);
If you've got an object that has variables that have a name with a space in it (such as when the variable has two words in the name), you can't access it with the usual syntax.
For example, normally you can use:
Student->Name
but if the field is "First Name" and not just "Name" then you have to use different syntax.
Student->{'First Name'}
When a form is created, it is generally assigned an action which determines what happens when the form is submitted. If the action is left blank, then the form will call itself by default.
echo '<form action="" method="POST">'.
An alternative method is to use
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">'.
however, this doesn't work when used within the context of a Joomla extension so use the first method.
The form is essentially broken up into to segments; the form segment and the processing segment. In order for the form script to determine which part of the script it is supposed to be acting on, you can check to see if $_POST['save'] has been set.
if(!isset($_POST['save'])) // form has not been submitted
This code is taken from http://php.net/manual/en/function.asort.php
The function works well but looses the original array indices.
function aSortBySecondIndex($multiArray, $secondIndex)
// sorts array by the specified index name
{
while (list($firstIndex, ) = each($multiArray))
$indexMap[$firstIndex] = $multiArray[$firstIndex][$secondIndex];
asort($indexMap);
while (list($firstIndex, ) = each($indexMap))
if (is_numeric($firstIndex))
$sortedArray[] = $multiArray[$firstIndex];
else $sortedArray[$firstIndex] = $multiArray[$firstIndex];
return $sortedArray;
}