Skip to main content

str_replace_array

Function str_replace_array 

Source
pub fn str_replace_array<'a>(
    search: &[&[u8]],
    replace: Replace<'_>,
    subject: &'a [u8],
    case_insensitive: bool,
) -> (Cow<'a, [u8]>, usize)
Expand description

PHP str_replace / str_ireplace with an array $search: applies each search/replacement pair in turn to the result of the previous one, skipping empty search strings, and returns the total count. The array forms of $subject apply this to each element (keys kept, counts summed); a string $search with an array $replace is a TypeError in PHP and cannot be expressed here.