Fixed incompatibility of str_replace with Zend

Modified the logic of str_replace function when 'subject' paramter passed to it is type of array and contains nested arrays. str_replace should keep nested array values untouched.