Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]ucinanie enterów
M4T3U5Z
post
Post #1





Grupa: Zarejestrowani
Postów: 56
Pomógł: 2
Dołączył: 24.05.2008
Skąd: Polandia

Ostrzeżenie: (0%)
-----


Mam taki prosty skrypt whois:

  1. <?php
  2. if ($_POST['domena']!=null)
  3. {
  4. $serwer = "whois.dns.pl";
  5. $domena = $_POST['domena'];
  6.  
  7. $f=fsockopen($serwer,43,$errno,$errstr,20);
  8. if ($f)
  9. {
  10.     $i=0;
  11.      fputs($f, "$domenar\n");
  12.     while(!feof($f))
  13.     {
  14.         $dane = fgets($f,256);
  15.         $dane = str_replace("\n", "<br>", $dane);
  16.  
  17.         $wynik[$i] = $dane;            
  18.         echo $wynik[$i];
  19.         $i++;
  20.  
  21.        
  22.     }
  23.     fclose($f);
  24. }
  25. }
  26. ?>


i teraz ucinam entery - poprzez zamianę ich na <br> str_replace("\n", "<br>", $dane); ale mimo zamiany one nadal tam pozostają... tz... chcę otrzymać:
(np. dla wp.pl)
  1. <br>DOMAIN: wp.pl<br>registrant's handle: nsk34186 (CORPORATE)<br>nameservers: ns1.wp.pl.[212.77.102.200]<br> dns.task.gda.pl. [153.19.250.100]<br> ns2.wp.pl. [153.19.102.182]<br>created: 1998.04.28 13:00:00<br>last modified: 2008.01.18 15:18:54<br><br>option created 2008.02.01 00:08:20<br><br><br>REGISTRAR: NASK<br>ul. Wawozowa 18<br>02-796 Warszawa<br>Polska/Poland<br>+48.22 3808300<br>info@dns.pl<br><br>WHOIS displays data with a delay not exceeding 15 minutes in relation to the .pl Registry system<br>Registrant data available at http://dns.pl/cgi-bin/en_whois.pl<br>://http://dns.pl/cgi-bin/en_whois.pl>


a dostaję
  1. <br>DOMAIN: wp.pl
  2.  
  3. <br>registrant's handle: nsk34186 (CORPORATE)
  4. <br>nameservers: ns1.wp.pl. [212.77.102.200]
  5. <br> dns.task.gda.pl. [153.19.250.100]
  6. <br> ns2.wp.pl. [153.19.102.182]
  7. <br>created: 1998.04.28 13:00:00
  8. <br>last modified: 2008.01.18 15:18:54
  9. <br>
  10. <br>option created 2008.02.01 00:08:20
  11. <br>
  12. <br>
  13. <br>REGISTRAR: NASK
  14. <br>ul. Wawozowa 18
  15. <br>02-796 Warszawa
  16. <br>Polska/Poland
  17. <br>+48.22 3808300
  18. <br>info@dns.pl
  19. <br>
  20. <br>WHOIS displays data with a delay not exceeding 15 minutes in relation to the .pl Registry system
  21. <br>Registrant data available at http://dns.pl/cgi-bin/en_whois.pl
  22. <br>


co robię nie tak?
przecież wyświetlanie echo $wynik[$i]; nie generuje dodatkowych enterów...
nie pomogło nawet podwójne wstawienie zamiany str_replace

Ten post edytował M4T3U5Z 20.11.2008, 13:20:45
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 22:06