$filecsv = 'urls.csv';
$data_array = array();
$row = 1;
if (($handle = fopen($filecsv, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
$row++;
$data_array[$data[0]] = $data[1];
}
fclose($handle);
}
$replacements = $data_array;
$string = htmlspecialchars($_POST["input"]);
$string = str_replace(array_keys($replacements), array_values($replacements), $string);