PHP code example of phpfn / placeholder

1. Go to this page and download the library: Download phpfn/placeholder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpfn / placeholder example snippets







var_dump(is_placeholder('_'));
// expected output: false

var_dump(is_placeholder(_));
// expected output: true



use Fun\Placeholder\Placeholder;

$array = [1, _, 3, _];

$result = Placeholder::map($array, fn() => ' map ');

echo implode(', ', $result);

// expected output: "1, map, 3, map"