Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
dvprog_09 [2015-02-11 22:37] Daniel Viström |
dvprog_09 [2015-02-11 22:44] Daniel Viström |
||
---|---|---|---|
Line 27: | Line 27: | ||
// Läser en textfil till en sträng. | // Läser en textfil till en sträng. | ||
$str = file_get_contents(' | $str = file_get_contents(' | ||
- | echo nl2br($str) . '< | + | echo nl2br($str) . '< |
// Läser in en textfil till en array, radbrytning ger ny " | // Läser in en textfil till en array, radbrytning ger ny " | ||
Line 36: | Line 36: | ||
while ($i < count($arr)) { | while ($i < count($arr)) { | ||
$row = explode(':', | $row = explode(':', | ||
- | // print_r($row); | + | // print_r($row); |
- | // Skriver bara ut de som heter Johansson | + | // Skriver bara ut de som heter Svensson |
- | if (trim($row[2]) == 'Johansson') { // trim tar bort radbrytning. | + | if (trim($row[2]) == 'Svensson') { // trim tar bort radbrytning. |
$temp = ' | $temp = ' | ||
- | file_put_contents(' | + | file_put_contents(' |
} | } | ||
$i++; | $i++; |