$lines = file($target_path)

$lines è l'array delle righe, vedi su php.net