Generation

generate functionMon, 14 Nov 2022

Find all specified characters in input and Dave to file.

function search_and_save_to_file($input, $character){ $arr = str_split($input); $data = ""; foreach ($arr as $ch) { if ($ch == $character) { $data .= $ch; } } file_put_contents("./data.txt", $data); } search_and_save_to_file("aabbccddee", "a");

Questions about programming?Chat with your personal AI assistant