Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Wsadzenie słowa do tablicy
mefjiu
post 15.06.2008, 16:08:36
Post #1





Grupa: Zarejestrowani
Postów: 313
Pomógł: 5
Dołączył: 22.03.2005

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


Jak z ciągu znaków np "12424"

uzyskać

array(
0 => 1
1 => 2
2 => 4
3 => 2
4 => 4
)
czyli każdy znak wsadzany do tbalicy ?
Go to the top of the page
+Quote Post
LonelyKnight
post 15.06.2008, 16:21:16
Post #2





Grupa: Zarejestrowani
Postów: 240
Pomógł: 13
Dołączył: 1.06.2007
Skąd: Wrocław

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


  1. <?php
  2. $strText = "1234567890abcd";
  3. $intTextLength = strlen($strText);
  4. $arrArray = array ();
  5.  
  6. for ($i=0; $i < $intTextLength; $i++) array_push($arrArray,$strText{$i});
  7. ?>


Ten post edytował LonelyKnight 15.06.2008, 16:23:41


--------------------
Good programming is 99% sweat and 1% coffee.
Make it idiot proof and someone will make a better idiot...
Go to the top of the page
+Quote Post
sobstel
post 15.06.2008, 16:21:58
Post #3





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

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


str_split" title="Zobacz w manualu PHP" target="_manual


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
mefjiu
post 15.06.2008, 16:25:27
Post #4





Grupa: Zarejestrowani
Postów: 313
Pomógł: 5
Dołączył: 22.03.2005

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


Dzieki
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: 28.03.2024 - 12:52