I wrote this PHP code to implement the Flesch-Kincaid Readability Score as a function:
function readability($text) { $total_sentences = 1; // one full stop =
Take a look at the PHP Text Statistics class on GitHub.