Hi- I'm having trouble getting the syntax correct for using fragment caching with W3 Total Cache.. Anyone been able to get this working properly?
Here's what I've got right now:
<!-- mfunc --> <?php $file = '/path/to/file.csv'; $fp = fopen($file, 'r'); $contents = fread($fp, filesize($file)); fclose($fp); $contents = explode(",", $contents); $var1 = $contents; $var2 = $contents; $var3 = $contents; echo ""; ?> <!-- /mfunc -->
I'm then attempting to output those 3 variables later on down the page. I'd seen that mfunc needs an echo inside of it, so I dropped in that empty echo, but no good.
Everything I've tried throws the error:
Inavalid mfunc tag syntax. Correct: <!-- mfunc PHP code --><!-- /mfunc --> or <!-- mfunc -->PHP code<!-- /mfunc -->.