We are working on a PHP-driven web site that will automatically censor and remove information for users that are not logged in.?
We need a reliable function to filter text and remove parts between and tags and return the result.
## Deliverables
Here is a detailed view of what we need....
#### Begin pseudo-cdoe
function censor_html($input){
// You create this part
return $something;
}
$sample='This information is not a secret. **The secret phone number is (123) 555-1234.
_Do not give it out_**? The mail phone number is (123) 555-1000.';
echo censor_html($sample);
/* Returns only:
This information is not a secret.? The mail phone number is (123) 555-1000.
*/
#### End
Everything between and is removed from the string.
- Note that other HTML tags my be between and .
- and may appear on different lines
- and will appear in lines with non-private text.
- We are responsible to calling the function when appropriate.? You are not required to integrate with our system... only create a fast, efficient function to accomplish this goal.
- Function cannot be klunky.? Should execute in 30 milliseconds or less from the command line interface (excluding time for the HTTP daemon) for a 10k byte input on an idle 2.8GHZ Linux core.?
## Platform
PHP (LAMP Stack)