PHP Trivia

Here are some PHP functions that I had to look up last week.

tempnam() – creates a new file unique name plus a given prefix in the current directory. You have to delete it yourself, but the return value is the full path to the temp file so it’s easy.

ob_start() – starts output buffering, which you might use if you want to do something with command line output generated by a function like exec() or passthru, speaking of:

passthru() – is like exec except instead of storing the output to a variable, it is outputted directly to the screen or browser.

xdiff_string_diff() – diff’s two strings and returns unified output similar to the CLI diff command.