- str_replace: documentation ( source)
- explode: documentation ( source)
<?php
$text = 'NL91 RABO 0157 8094 63 4837
NL78 RABO 0135 0695 99 4829
NL39 RBRB 0827 4287 31 4823
NL63 RABO 0151 5685 02 4825
NL77 RABO 0151 8976 62 4935
NL24 RABO 0159 7351 49 4819
NL75 RABO 0128 6474 77 4821
NL69 DEUT 0540 7045 98 4815
NL49 RABO 0129 6430 68 4827
NL92 RABO 0166 3531 08 4831
NL86 RABO 0183 6005 92 5521
NL38 INGB 0007525857 5901';
$lines = explode(PHP_EOL, $text);
foreach($lines as $line){
list($iban, $klantid)=explode("\t", $line);
$iban = str_replace(' ', '', $iban);
//echo "select * from klanten WHERE klantid='".$klantid."' and REPLACE(iban, ' ', '') = '".$iban."';".PHP_EOL;
echo "UPDATE klanten SET iban='' WHERE klantid='".$klantid."' and REPLACE(iban, ' ', '') = '".$iban."';".PHP_EOL;
}