Satz in variablen

5im0n

Mitglied
Hallo,
ich möchte einen Satz, bsp:
Hallo-Welt-1
in
$a = 'Hallo';
$b = 'Welt';
$c = '1';
aufteilen. Also immer hinter dem bindestrich.
Ist das möglich?
Und wenn ja wie.
Gruß
5im0n
 
Und wenn man reguläre Ausdrücke benutzen will, sollte man direkt [phpf]preg_split[/phpf] verwenden, wie es php.net auch empfiehlt:

split hat gesagt.:
preg_split(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to split(). If you don't require the power of regular expressions, it is faster to use explode(), which doesn't incur the overhead of the regular expression engine.
 

Neue Beiträge

Zurück