Talking PHP

I just figured out how to trigger speech from PHP on MacOS X. I’m finding it handy for debugging, but it has opened up a whole new world of stupid possibilities.

if ($condition) {
    say("Hello");
}

function say($something)
{
    exec("osascript -e 'say "$something"'");
}

Comments