Jump to content

preg_replace HTML formatting


kodie

Recommended Posts

Hey guys, I've got a little problem that I can't seem to find the answer to...

 

I have a string like this:

$oldstring = "<test1>here is some text</test1>";

 

and what I want to do is get "test1" and "here is some text" into 2 separate strings kind of like this:

 

$newstring[0] = "test1";
$newstring[1] = "here is some text";

 

I figured I'd use preg_replace to do this but no luck. I know the answer has to be something simple but I just can't figure it out.

 

Thanks for any help you can give!

Link to comment
https://forums.phpfreaks.com/topic/213931-preg_replace-html-formatting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.