Printable PHP Array Reference
Open the one-page PHP array sheet and print it from your browser. Choose Print or use Ctrl+P on Windows and Linux or Command+P on a Mac. Use the default scale on A4 or US Letter paper. To keep a copy offline, select Save as PDF in the print dialogue.
The sheet is for work with PHP lists and associative arrays. It shows which operations keep the original keys and what to change if a filtered list needs to become a JSON array.
Try it with a real input shape
Section titled “Try it with a real input shape”Save the sample JSON dataset next to your PHP script. Decode the downloaded text as an associative array, then extract the titles:
<?php
$contents = file_get_contents(__DIR__ . '/library-books.json');if ($contents === false) { exit("Download library-books.json first.\n");}
$books = json_decode($contents, true, 512, JSON_THROW_ON_ERROR);$titles = array_column($books, 'title');
echo count($titles), PHP_EOL; // 8echo $titles[0], PHP_EOL; // Stars, Maps, and TidesFor more examples, follow the PHP arrays lesson or look for a specific task in the examples index.