What data sanitzation function should be used to store entire source code of webpage?

What is the best data santization function to use when the entire source code of a webpage (head, body elements, etc) are going to be stored in a post meta field?

In other words, which function will encode the most html tags while avoiding dropped data?

Related posts