The following code was executed.
What will the following code print, and why?
- echo TRUE;
Wordpress has a couple of rarely used functions that allow author information to be displayed for the current post and a list of all of the authors on the blog.
Adding a written by message to your posts is not difficult at all. Just use the the_author_posts_link() function inside the post loop.
The first thing you learn about in PHP is probably how to print something. This is usually done with a call to the echo or print, but there is another way to print things by writing content directly to the output buffer. The following code looks like you are writing to a file, but the text will appear in the browser window because we are writing to the php://output output stream.
When printing off source code there is a handy function that will parse the code and produce nice looking syntax highlighted code. There are actually two functions you can use. The highlight_string() function takes a string as a parameter and will print the highlighted code. The highlight_file() function takes a file name as a parameter, the contents of which are printed off with highlighted syntax. For now I will concentrate on the highlight_string() function, but the output of these two functions is the same.