Answers for "stop if in php"

PHP
2

how to set ist in php

date_default_timezone_set('Asia/Kolkata');
Posted by: Guest on April-29-2020
1

php remove line if it contains string

$rows = file("problem.txt");    
$blacklist = "foo|bar|lol";

foreach($rows as $key => $row) {
    if(preg_match("/($blacklist)/", $row)) {
        unset($rows[$key]);
    }
}

file_put_contents("solved.txt", implode("\n", $rows));
Posted by: Guest on August-27-2020

Browse Popular Code Answers by Language