PHP Forum

PHP Forum (http://www.selfphp.de/forum/index.php)
-   PHP für Fortgeschrittene und Experten (http://www.selfphp.de/forum/forumdisplay.php?f=13)
-   -   Array elemente zu String (http://www.selfphp.de/forum/showthread.php?t=2304)

Loki 02.10.2002 11:19:54

Array elemente zu String
 
Hallo Leute !!

ich möchte gerne Array Elemente in einen String packen um ein explode auf ihn auszuführen aber er gibt mir immer nur "Array" aus und nicht den Inhalt des Elements

hier mein code
<code>
$i = 0;
$verz=opendir ('../block/');
while ($file = readdir ($verz))
{
if($file != "." && $file != "..")
{
$arr[$i] = $file;
$i++;
}
}
closedir($verz);

for ($a = 0; $a <= sizeof($arr);$a++)
{



$string = $arr[$a];
$string2 = explode(".",$string);
echo $string2."<br>";

}
</code>

kann mir da jemand helfen ???

MiH 02.10.2002 11:33:04

Code:

$verz=opendir ('../block/');
while ($file = readdir ($verz)){
 if(!preg_match("^.{1,2}$",$file)){
  $arr[] = $file;
 }
}
closedir($verz);

for ($a = 0; $a <= count($arr);$a++){
 $string .= $arr[$a];
}
echo $string."<br />";



Alle Zeitangaben in WEZ +2. Es ist jetzt 22:17:16 Uhr.

Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.