General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 19th, 2003, 01:39 AM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 236 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 50 m 19 sec
Reputation Power: 6
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
Exclamation Preg Replace Problem

on my news site I have a regular expression that changes " squote " to "'" and a line break (\n) to <br />. However the function does not seem to want to work and I have no idea why. I have included the necessary files. you can also see the output at http://www.suanhacky.org/TEST/news.php
Attached Files
File Type: zip chornjr_preg_replace.zip (3.7 KB, 345 views)
__________________
CHornJr
"One day I'll know what I am doing"
My Blog
Suanhacky Lodge #49
Rebel Squadrons

Reply With Quote
  #2  
Old November 19th, 2003, 07:08 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
It won't work for me when I use arrays either. Weird. Just perform each match separately:

PHP Code:
 $x=preg_replace("/ squote /","'",$str);
$x=preg_replace("/\n/","<br>",$str); 


That worked for me.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Preg Replace Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT