fork(1) download
  1. <?php
  2.  
  3. $book = [ 'title' => 'Treny',
  4. 'authors' => 'Jan Kochanowski'
  5. ]; // wstawianie
  6. $books=[];
  7. var_dump(empty($books)); // funkcja empty - pusty
  8. $books[] = $book; // dodawanie
  9. $books[] = $book;
  10. $books[1]['title'] = 'TRENY';
  11. var_dump($books);
  12. $ile=count($books);
  13. print $ile;
  14. unset($books[$ile-1]['title']); // usun wartość (nie element)
  15. var_dump($books);
  16. var_dump(isset($books[$ile-1]['title']));
  17. // isset - funkcja - czy zdefiniowana wartość
Success #stdin #stdout 0.02s 24380KB
stdin
Standard input is empty
stdout
bool(true)
array(2) {
  [0]=>
  array(2) {
    ["title"]=>
    string(5) "Treny"
    ["authors"]=>
    string(15) "Jan Kochanowski"
  }
  [1]=>
  array(2) {
    ["title"]=>
    string(5) "TRENY"
    ["authors"]=>
    string(15) "Jan Kochanowski"
  }
}
2array(2) {
  [0]=>
  array(2) {
    ["title"]=>
    string(5) "Treny"
    ["authors"]=>
    string(15) "Jan Kochanowski"
  }
  [1]=>
  array(1) {
    ["authors"]=>
    string(15) "Jan Kochanowski"
  }
}
bool(false)