Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php] explode()
Regyam
post 20.12.2007, 21:07:11
Post #1





Grupa: Zarejestrowani
Postów: 79
Pomógł: 0
Dołączył: 8.04.2007

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


A więc mam:
  1. <?php
  2. $string = "abc def";
  3. $tablica = explode(" ", $string);
  4. ?>

No a w tablicy wypisuje mi się:
Kod
Array(
[0] => abc
[1] =>
[2] => def
)

No a powiedzmy ta spacje powinno pominąć. Jak to naprawić?

Ten post edytował Regyam 20.12.2007, 21:07:26
Go to the top of the page
+Quote Post
Cysiaczek
post 20.12.2007, 21:10:43
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Coś podałeś nie tak - mój wynik tego skryptu jest prawidłowy:
Kod
Array ( [0] => abc [1] => def )


Zobacz, czy nie masz tam dwóch spacji.

Pozdrawiam.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 19.07.2025 - 17:09