PROGRAMMING

 
REMEMBERS




Last update:   29-10-2021

Search grep

Search in an array with regex.
 
$haystack = array (
    'say hello',
    'hello minte9',
    'hello world',
    'foo bar bas'
);

$matches  = preg_grep ('/^hello (\w+)/', $haystack);

var_dump($matches);
    //Array ( [1] => hello minte9 [2] => hello world )
... 4 lines
 

Questions    
Find and replace

        A B C D E F
🔔
1/2