content); $credentials = []; foreach ($items as $item) { preg_match_all('/URL:\s(.*)\nUsername:\s(.*)\nPassword:\s(.*)\nApplication:\s(.*)\n/m',$item,$matches); $credentials[] = [ 'url' => trim($matches[1][0] ?? ''), 'username' => trim($matches[2][0] ?? ''), 'password' => trim($matches[3][0] ?? ''), 'application' => trim($matches[4][0] ?? '') ]; } return $credentials; } }