PHP str_replace düzgün çalışmıyor

0 Cevap php

I'm using str_replace and it's not working correctly. I have a text area, which input is sent with a form. When the data is received by the server, I want to change the new lines to ",".

$teams = $_GET["teams"];
$teams = str_replace("\n",",",$teams);
echo $teams;

Garip, ben aşağıdaki sonucu alırsınız

Chelsea

Gerçek

, Barcelona

instead of ChealseaGerçek, Barcelona.

Ne oldu?

0 Cevap