\r \n should not be shown in view

Hi guys,
following yii2 order will show me content of database:

.
.
               <?=
                    Html::a(
                            Html::img(
                                    "@web/img/$ArrayOfFilename[$i]", ['alt' => 'PicNotFound', 'class' => 'img-circle', 'style' => 'width:125px;height:125px']
                            ), ['/immobilien/index', 'id' => $ArrayOfImmo[$i]], ['title' => 'Immobiliendaten abrufen', 'data' => ['pjax' => '0']]
                    )
                    ?>
.
.

Online(Linux,nginx), this code won’t do any problems. Under developpment system(windows,xampp), output will be like this:
printOut

The red line marked sequences should not be readable. How could I achieve my intention?
Here is Controller code, which will render this file respectively link:

public function actionIndex($id) {
    $art = Immobilien::findOne(['id' => $id])->l_art_id;
    $searchModel = new ImmobilienSearch();
    $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $id, $art);
    return $this->render('index', [
                'searchModel' => $searchModel,
                'dataProvider' => $dataProvider,
                'art' => $art
    ]);
}

try nl2br if you want the lines to be on separates lines otherwise replace with preg_replace what you don’t need

Ur suggestion will not work: Following order won’t change anything, 'cause content of database will not be affected of this code:

 $string = $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'art' => $art,
            'id' => $id,
        ]);
        $string = nl2br($string);
        $keywords = '<br />';
        $keywords = preg_quote($keywords, '/');
        $string = preg_replace('/' . $keywords . '/', " ", $string);
        return $string;