Welcome to the Cookbook

loading...

8.5.11 remove

There is no translation yet for this section. Please help out and translate this.. More information about translations

array Set::remove ($list, $path = null)

Removes an element from a Set or array as defined by $path.

$a = array(
	'pages'     => array('name' => 'page'),
	'files'		=> array('name' => 'files')
);

$result = Set::remove($a, 'files');
/* $result now looks like: 
	Array
	(
	    [pages] => Array
	        (
	            [name] => page
	        )

	)
*/
  1. $a = array(
  2. 'pages' => array('name' => 'page'),
  3. 'files' => array('name' => 'files')
  4. );
  5. $result = Set::remove($a, 'files');
  6. /* $result now looks like:
  7. Array
  8. (
  9. [pages] => Array
  10. (
  11. [name] => page
  12. )
  13. )
  14. */