1234567891011121314151617181920212223242526 |
- #cleanHTML
- !Removes Whitespace from between HTML tags in a string.
- ! Purpose is because having whitespace in writing code makes readablility,
- ! but the rendering engine adds extra lines at top for no reason.
- !
- ! $ARGS[0] = is the string to be cleaned up.
- !
- ! Call this as a Function to get the cleaned string returned
- ! example:
- ! *pl func('cleanHTML', $HTMLString)
- $cleanHTML['Input'] = trim($ARGS[0])
- $cleanHTML['ReturnStr'] = ""
- $cleanHTML['tab'] = " "
- $cleanHTML['newline'] = "
- "
- !Strip out newlines and tabs, which should not be in the string
- $cleanHTML['ReturnStr'] = replace($cleanHTML['Input'],$cleanHTML['newline'],"")
- $cleanHTML['ReturnStr'] = replace($cleanHTML['ReturnStr'],$cleanHTML['tab'],"")
- $result = $cleanHTML['ReturnStr']
- killvar '$cleanHTML'
- killvar 'i'
- --- cleanHTML ---------------------------------
|