# Specification for PHP Facebook has dedicated all copyright to this specification to the public domain worldwide under the CC0 Public Domain Dedication located at . This specification is distributed without any warranty. (Initially written in 2014 by Facebook, Inc., July 2014) **Table of Contents** EOS; $output = ""; foreach (spec_files() as $fileName => $path) { $contents = file_get_contents($path); foreach (heading_info($contents) as $info) { $title = $info['title']; $anchor = $info['anchor']; $indent = str_repeat(' ', $info['level']); $output .= "$indent- [$title]($fileName#$anchor)\n"; } } file_put_contents($tocFile, "$prefix\n$output");