RE: [PHP] preg_replace() 'space' the final frontier
| From: | Matthew Walker | Date: | Wed, 30 Jan 2002 19:47:28 +0000 |
| Subject: | RE: [PHP] preg_replace() 'space' the final frontier | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82795@lists.php.net to get a copy of this message | ||
$statement=preg_replace("/ /","<br>",$original,19);
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs
-----Original Message-----
From: hugh danaher [mailto:hdanaher@earthlink.net]
Sent: Wednesday, January 30, 2002 12:35 PM
To: Php-General
Subject: [PHP] preg_replace() 'space' the final frontier
What I am trying to do is have a line of text break at a "space" after
reading 19 words. Having read the various methods of finding and
replacing one character with another, I settled on preg_replace as my
best choice, but this function doesn't accept a space in the regular
expression slot. What can I do to get around this, or is there a better
function than the one I selected?
$statement=preg_replace(" ","<br>",$original,19);
Warning: Empty regular expression in /home/www/host/document.php on
line 71
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002