Try this code for remove html tags in array values:
you can used single variable to remove tags means you can strig_tags()
sample code for remove html :
<?php
echo strip_tags("Hello <b><i>world!</i></b>","<b>");
?>
and also remove html tags in array method:
function stripAllFields(&$fields) {
foreach ($fields as $key => $value) {
if (is_array($fields[$key])) { stripAllFields($fields[$key]); }
else { $fields[$key] = strip_tags($value); }
}
}
Here you can remove multi dimension array values also.
And convert html code into bbcode in php :
Refer this url:
Refer Link 1
Refer Link 2
And also PHP function are present for BBcode create and parser:
PHP BBCODE_PARSER
PHP BBCODE_CREATE