private function processData() {
    $data = $this->filteredData;

    // Replace <span class="subbed"> with normal text.
    foreach ($data as &$item) {
      preg_match('/<span class=\"subbed\".*><br>(.*)<\/span>/', $item->address_1, $test);
      if (!empty($test)) {
        $item->address_1 = str_replace($test[0], ' ' . $test[1], $item->address_1);
      }
      preg_match('/<span class=\"subbed\".*><br>(.*)<\/span>/', $item->instructor, $test1);
      if (!empty($test1)) {
        $test1[1] = str_replace('(sub for ', '', $test1[1]);
        $test1[1] = str_replace(')', '', $test1[1]);
        $item->instructor = str_replace($test1[0], '<br><span class="fa fa-refresh" aria-hidden="true"></span><span class="sub">' . $test1[1] . '</span>', $item->instructor);
      }
    }

    $this->processedData = $data;
  }
private function processData() {
    $data = $this->filteredData;

    // Replace <span class="subbed"> with normal text.
    foreach ($data as &$item) {
      preg_match('/<span class=\"subbed\".*><br>(.*)<\/span>/', $item->address_1, $test);
      if (!empty($test)) {
        $item->address_1 = str_replace($test[0], ' ' . $test[1], $item->address_1);
      }
      preg_match('/<span class=\"subbed\".*><br>(.*)<\/span>/', $item->instructor, $test1);
      if (!empty($test1)) {
        $test1[1] = str_replace('(sub for ', '', $test1[1]);
        $test1[1] = str_replace(')', '', $test1[1]);
        $item->instructor = str_replace($test1[0], '<br><span class="fa fa-refresh" aria-hidden="true"></span><span class="sub">' . $test1[1] . '</span>', $item->instructor);
      }
    }

    $this->processedData = $data;
  }
private function processData ( ) { $ data = $ this -> filteredData ; // Replace <span class="subbed"> with normal text. foreach ( $ data as & $ item ) { preg_match ( '/<span class=\"subbed\".*><br>(.*)<\/span>/' , $ item -> address_1 , $ test ) ; if ( ! empty ( $ test ) ) { $ item -> address_1 = str_replace ( $ test [ 0 ] , ' ' . $ test [ 1 ] , $ item -> address_1 ) ; } preg_match ( '/<span class=\"subbed\".*><br>(.*)<\/span>/' , $ item -> instructor , $ test1 ) ; if ( ! empty ( $ test1 ) ) { $ test1 [ 1 ] = str_replace ( '(sub for ' , '' , $ test1 [ 1 ] ) ; $ test1 [ 1 ] = str_replace ( ')' , '' , $ test1 [ 1 ] ) ; $ item -> instructor = str_replace ( $ test1 [ 0 ] , '<br><span class="fa fa-refresh" aria-hidden="true"></span><span class="sub">' . $ test1 [ 1 ] . '</span>' , $ item -> instructor ) ; } } $ this -> processedData = $ data ; }
Process data.
Process data .