[], 'css' => null, 'html' => null, ]; if ($count >= 3) { $result['settings'] = parse_ini_string($sections[0], true); $result['css'] = $sections[1]; $result['html'] = $sections[2]; } elseif ($count == 2) { $result['settings'] = parse_ini_string($sections[0], true); $result['html'] = $sections[1]; } elseif ($count == 1) { $result['html'] = $sections[0]; } return $result; } public static function sections($path) { return PDFParser::parse(File::get(View::make($path)->getPath())); } }