I have an array of objects:
$obj = array();
// add the new items
$row = new stdClass();
$row->first = $first;
$row->last = $last;
$row->phone = $phone;
$obj[] = $row;
Now, if I only have the value of $last, is there a way to delete the entire $row object without specifying each key/value?
(If it helps to understand, if it was a mysql statement it would be something like “DELETE * FROM $obj WHERE $row->last = ‘Thomas’ “)
thx
You need to know the key. However, if you iterate through the array you can find it.
There may be a terser approach with some of the
array_*functions, but this lays it out.