View Single Post
Old 26-01-2006, 11:42 AM   #7
Kon-Tiki
[BANNED]

 
Join Date: Sep 2004
Location: Dentergem, Belgium
Posts: 1,811
Default

Var_dump() gives wrong results too.
Code:
$string = "kakakapipikaka";
$reg_ex = "(ka)";
eregi($reg_ex, $string, $test);
echo "Test: ", var_dump($test), "<br>";
Output:
Code:
Test: array(2) { [0]=> *string(2) "ka" [1]=> *string(2) "ka" }
The way that should be, would be [0]=> string(2) "ka" [1]=> string(2) "ka" [2]=> string(2) "ka" [3]=> string(2) "ka" [4]=> string(2) "ka" [5]=> string(2) "ka" (with something different for [0]), if I understand correctly.

A different solution works now, though.
$number = preg_match_all($reg_ex, $string, $resultaat) returns 5
Kon-Tiki is offline                         Send a private message to Kon-Tiki
Reply With Quote