Welcome, Guest. Please login or register.
Did you miss your activation email?
02/08/12, 08:32
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+  replace <strong> and </strong> to <b></b> with php
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: replace <strong> and </strong> to <b></b> with php  (Read 1904 times)
Pluda
Senior Programmer
****
Posts: 270


View Profile
« on: 04/21/09, 04:22 »

hello,

i have to work with html formated text in one textArea, but need to transform certain tags to the ones flash can correctly read

I was trying with this, for strong tag, but no luck

Code:

$tag_strong = array('<strong>', '<\/strong>');
$bold = array('<B>', '</B>');
for ($i=0; $i<count($tag_strong); $i++) {
$a_procurar[$i] = "/".$tag_strong[$i]."/";
$valor = @preg_replace($a_procurar[$i], $bold[$i], $valor);
};


how can i do this?, or even better, how to have an array of what to replace and a kind of regex to do the replacement?

hope you can help me,

thanks

Logged
Pluda
Senior Programmer
****
Posts: 270


View Profile
« Reply #1 on: 04/22/09, 06:29 »

hello,

i've made it work, but still need some help

searching the net doesn't seem to solve this problem


how do I make a regex to match

<div(SOME TEXT HERE LIKE PER EXAMPLE align = "left") PLUS >

?

if I can manage this, I can then replace <div align = "left"> to <text align = "left"> and flash is able to read the html formated text


thanks,
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything