And once you've learnt about arrays, look into array_map().
Here's a quick spike:
/**
* Add 1 to $int
*
* @param int $int
* @return int
*/
function increment($int)
{
return $int + 1;
}
// initialise test array
$b=array_fill(0,10,rand(1,100));
// apply increment to each value of $b and save to $ta
$ta = array_map('increment',$b);
// Test results
// old vals
echo '<h2>Old values</h2>';
echo '<em>Randomly generated numbers filled initial array</em>';
echo '<pre>';
print_r($b);
echo '</pre>';
// new vals
echo '<hr />';
echo '<h2>New values</h2>';
echo '<em>Randomly generated numbers in initial array should be incremented by 1</em>';
echo '<pre>';
print_r($ta);
echo '</pre>';
echo '<hr />';
HTH