phpbar.de logo

Mailinglisten-Archive

[php] String parsen

[php] String parsen

Andreas Demmer andreas at phpbar.de
Don Aug 7 22:44:31 CEST 2003


> 
> zu einzelnen Variablen mache (ausgabe echo $PROVIDERID; -> 90)

$string = 'PROVIDERID="90" PROVIDERNAME="Saferpay Test Card"';
$varStrings = explode(' ', $string);

foreach($varStrings as $varString) {
    $varString = explode('=', $varString);
    $varString[1] = substr($varString[1], 1, strlen($varString[1]) - 1);

    $$varString[0] = $varString[1];
}

(ungetestet)

Gruss,
Andreas



php::bar PHP Wiki   -   Listenarchive