regular expression adaptation

From: Date: Fri, 27 Oct 2000 04:53:16 +0000
Subject: regular expression adaptation
Groups: php.general 
Request: Send a blank email to php-general+get-22268@lists.php.net to get a copy of this message
Hello, I have a Perl regexp that I need to implement in PHP, how would I do the following in PHP: (perl code) $str =~ s/(\w{$len})/$1-<BR>/g this code inserts a hyphen and html newline every $len characters in string $str. I looked at ereg() and its kin but could not see a suitable way to do this. Thanks in advance /Cody Caughlan

« previous php.general (#22268) next »