Jump to content

Searching and deleting from an array???


eng_coo

Recommended Posts

Hi,

thanks thats great just what i wanted. But as i am new to php could you explain what the line -

unset($a[array_search($remowe,$a)]);

means. i know it searches the array for the value but, i have never come across 'unset' before. is it basically just delete from varible $a and can it only be used with arrays?

thanks

john
unset is to unset() a varable

when you use the code below your only see one echoed redarrow
as the seconed ecohed redarrow is unset.

good luck.
[code]
<?php
// name is redarrow
$name="redarrow";
/// echo the name redaarow
echo $name;
//unset varable $name what was redarrow
unset($name);
// echo name now nothink why becouse we unset the varable........
echo $name;
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.