Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 12-10-2008, 10:45 PM No ending delimiter
Super Talker

Posts: 102
Trades: 0
I am trying to add the apostrophe as a bbcode.

Code:
Warning:  preg_replace() [function.preg-replace]: No ending delimiter '/' found in C:\web\www\code-bin\main\setup.php on line 652


and the code

PHP Code:
function bbcode($str) {
        
$simple_search = array(
                                
"/\[b\](.*?)\[\/b\]/is",                               
                                
"/\[i\](.*?)\[\/i\]/is",                               
                                
"/\[u\](.*?)\[\/u\]/is",
                
"/\[center\](.*?)\[\/center\]/is",
                
"/\[color\=(red|green|blue|yellow)\](.*?)\[\/color\]/is",
                
"/\[url=(.*?)\](.*?)\[\/url\]/is",
                
"/\[img\](.*?)\[\/img\]/is",
                
"/\\'\/"
                                
);

        
$simple_replace = array(
                                
"<strong>$1</strong>",
                                
"<em>$1</em>",
                                
"<u>$1</u>",
                
"<center>$1</center>",
                
"<font color=\"$1\">$2</font>",
                
"<a href=\"$1\" target=\"_blank\">$2</a>",
                
"<img src=\"$1\" alt=\"[image]\"/>",
                
"&prime;"
                                
);

        
// Do simple BBCode's
        
$str preg_replace ($simple_search$simple_replace$str);

        return 
$str;

Aaron™ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-11-2008, 02:21 AM Re: No ending delimiter
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
PHP Code:
function bbcode($str) {
        
$simple_search = array(
                                
"/\[b\](.*?)\[\/b\]/is",                               
                                
"/\[i\](.*?)\[\/i\]/is",                               
                                
"/\[u\](.*?)\[\/u\]/is",
                
"/\[center\](.*?)\[\/center\]/is",
                
"/\[color\=(red|green|blue|yellow)\](.*?)\[\/color\]/is",
                
"/\[url=(.*?)\](.*?)\[\/url\]/is",
                
"/\[img\](.*?)\[\/img\]/is",
                
"/\'/"
                                
);

        
$simple_replace = array(
                                
"<strong>$1</strong>",
                                
"<em>$1</em>",
                                
"<u>$1</u>",
                
"<center>$1</center>",
                
"<font color=\"$1\">$2</font>",
                
"<a href=\"$1\" target=\"_blank\">$2</a>",
                
"<img src=\"$1\" alt=\"[image]\"/>",
                
"&prime;"
                                
);

        
// Do simple BBCode's
        
$str preg_replace ($simple_search$simple_replace$str);

        return 
$str;

__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 12-11-2008, 05:59 PM Re: No ending delimiter
Super Talker

Posts: 102
Trades: 0
Thank you.
Aaron™ is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to No ending delimiter
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13839 seconds with 12 queries