so, ich habe selber was gefunden, ein Algoritmus (wie schreibt man das eigentlich) war nicht notwendig, PHP hat was entsprechendes "eingebaut"
falls es jemand interessiert, (aus der offiziellen Hilfe php.net)
---------
strtr() can be called with only two arguments. If called with two arguments it behaves in a new way: from then has to be an array that contains string -> string pairs that will be replaced in the source string. strtr() will always look for the longest possible match first and will *NOT* try to replace stuff that it has already worked on.
Examples:
$trans = array("hello" => "hi", "hi" => "hello");
echo strtr("hi all, I said hello", $trans) . "\n";
This will show: "hello all, I said hi",
----------


LinkBack URL
About LinkBacks
Zitieren