הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 28-08-06, 11:42   # 2
RS324
תודה על תרומתך.
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 3,173

RS324 לא מחובר  

אתה מדבר על 2 דברים שונים
בכל מקרה בשביל להחליף את CODE אתה צריך להשתמש ב PREG_REPLACE

תיכף אני יביא לך את הקוד המדוייק


בבקשה

תשתמש במה שאתה רוצה :

PHP קוד:
$patterns = array(

                                    
'`\[b\](.+?)\[/b\]`is',
                                    
'`\[i\](.+?)\[/i\]`is',
                                    
'`\[u\](.+?)\[/u\]`is',
                                    
'`\[strike\](.+?)\[/strike\]`is',
                                    
'`\[color=#([0-9]{6})\](.+?)\[/color\]`is',
                                    
'`\[email\](.+?)\[/email\]`is',
                                    
'`\[img\](.+?)\[/img\]`is',
                                    
'`\[url=([a-z0-9]+://)([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*?)?)\](.*?)\[/url\]`si',
                                    
'`\[url\]([a-z0-9]+?://){1}([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)\[/url\]`si',
                                    
'`\[url\]((www|ftp)\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*?)?)\[/url\]`si',
                                    
'`\[flash=([0-9]+),([0-9]+)\](.+?)\[/flash\]`is',
                                    
'`\[quote\](.+?)\[/quote\]`is',
                                    
'`\[indent](.+?)\[/indent\]`is',
                                    
'`\[size=([1-6]+)\](.+?)\[/size\]`is'
                                

                                
);

$replaces =  array(

                                    
'<strong>\\1</strong>',
                                    
'<em>\\1</em>',
                                    
'<span style="border-bottom: 1px dotted">\\1</span>',
                                    
'<strike>\\1</strike>',
                                    
'<span style="color:#\1;">\2</span>',
                                    
'<a href="mailto:\1">\1</a>',
                                    
'<img src="\1" alt="" style="border:0px;" />',
                                    
'<a href="\1\2">\6</a>',
                                    
'<a href="\1\2">\1\2</a>',
                                    
'<a href="http://\1">\1</a>',
                                    
'<object width="\1" height="\2"><param name="movie" value="\3" /><embed src="\3" width="\1" height="\2"></embed></object>',
                                    
'<strong>Quote:</strong><div style="margin:0px 10px;padding:5px;background-color:#F7F7F7;border:1px dotted #CCCCCC;width:80%;"><em>\1</em></div>',
                                    
'<pre>\\1</pre>',
                                    
'<h\1>\2</h\1>'
                                    
                                    

                                    
);


$string preg_replace($patterns$replaces $string); 

Last edited by RS324; 28-08-06 at 11:44..
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
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 מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 18:02.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ