hi first
i am actually working on a php search enginge, and have two problems. if someone could give me a hint i would be glad
ok - the first prob:
i can get a search string where the words are sepereated by commas easily into an array.
but if i try to do the same with google styled input i get mad
it's easy to seperate words by their spaces and explode them into an array, but how can i get the words combined by " into the same array?
you know, if someone searches for:
president "bill clinton" cigar
any ideas?
the second problem is probably simple - think i am just dumb:
i want to get a "dynamic" variable, which gains one digit in each "while" loop.
$variable1
$variable2
$variable3
but i can't get it to work (probably it works some way with $ - $$variable?)
thanks for reading
k@pixelfighters
ps: any tips for a more simple version of my whitespace replacement at the comma?
code snipplet here (just test style :-)
$string = "what, the,fuck , is , security?";
do {
$string = ereg_replace (" "," ", $string);
$string = ereg_replace (",",",", $string);
$string = ereg_replace (", ",",", $string);
$string = ereg_replace (", ",",", $string);
$string = ereg_replace (" ,",",", $string);
$string = ereg_replace (" ,",",", $string);
$stringreplace++;
}
$string = ereg_replace (" "," ", $string);
printf("$string<br><br>");
$sucheingabe = explode(",",$string);
$counter="0";
foreach ($sucheingabe as $words) {
$counter++;
$dynamic_variable???{$counter}???= "$words";
}