I think he wants to put some kind of magic statement into a textfile which automagically parsed the entire file’s contents and replaces all smiley-tags with images.
However, that doesn’t work.
What you can do is something like:
// Read entire file into a string.
$text = file_get_contents('textfile.txt');
// Convert all smileys to image tags using stereofrogs function:
$text = parseEmoticons($text);
You might even want to overwrite the original file, so you only do it once.