/**
* Removes all commentd, tabs and new-line characters to compact the content
*
- * @param $content The uncompacted content
- * @return $content The compacted content
+ * @param $uncompactedContent The uncompacted content
+ * @return $compactedContent The compacted content
*/
- public function compactContent ($content) {
+ public function compactContent ($uncompactedContent) {
// First, remove all tab/new-line/revert characters
- $content = str_replace("\t", '', str_replace("\n", '', str_replace("\r", '', $content)));
+ $compactedContent = str_replace("\t", '', str_replace("\n", '', str_replace("\r", '', $uncompactedContent)));
// Then regex all comments like <!-- //--> away
- preg_match_all('/<!--[\w\W]*?(\/\/){0,1}-->/', $content, $matches);
+ preg_match_all('/<!--[\w\W]*?(\/\/){0,1}-->/', $compactedContent, $matches);
// Do we have entries?
if (isset($matches[0][0])) {
// Remove all
foreach ($matches[0] as $match) {
// Remove the match
- $content = str_replace($match, '', $content);
+ $compactedContent = str_replace($match, '', $compactedContent);
} // END - foreach
} // END - if
// Return compacted content
- return $content;
+ return $compactedContent;
}
}