Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PHP output
Domson502
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 16.05.2016

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


To ponownie ja ;D . Jak zmienic ten kod żeby nie był wypisywany za pomocą "echo" tylko za pomocą "dump($output)" ? Z góry dzięki za odpowiedź.

  1. function drawColoredTable($input) {
  2. print "<table>";
  3. $input = str_replace(' ', '', $input);
  4. $n = strlen((string) $input);
  5. for ($i = 0; $i < $n; $i++) {
  6.  
  7. if ($i % 2) {
  8. echo '<tr bordercolor="#000000">';
  9. } else {
  10. echo '<tr bgcolor="#000000" style="color: #ffffff;">';
  11. }
  12. echo "<td>{$input[$i]}</td></tr>";
  13. }
  14.  
  15.  
  16. print "</table>";
  17. }
  18.  
  19. dump($output);
  20.  
  21. drawColoredTable('War, has never been so much fun.');
  22. drawColoredTable('All You Need Is Love.');
  23. drawColoredTable('Heard tenthous and whispering and nobody listening.');
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: 16.10.2025 - 08:20