PHP code example of imanghafoori / php-search-replace

1. Go to this page and download the library: Download imanghafoori/php-search-replace 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/ */

    

imanghafoori / php-search-replace example snippets


$user = 1;;
$user = 2; ;
$user = 3;
;


$pattern = [';;' => ['replace' => ';']];

$a = [
   '1',
   '2',
];
$b = ['1','2',];

$pattern = [',<whitespace>?]' => ['replace' => '"<1>"]']];