HTML tags and PHP
- Started
- Last post
- 21 Responses
- MrDaro
In a php file I have a variable that's basically an html formatted text with images and embedded media. I need to seperate the text and media in order to display them on two separate divs. However this is not working. I have:
...
$htmlParagraph = "<p>Lorem Ipsum...(some images)...(some youtube videos)...etc....;
echo strip_tags($htmlParagraph, '<p><a><h2><blockquote><code><ul><li>') ;
//Displays just the text as expected.echo strip_tags(get_the_content(), '
<embed><object>');
// Displays the images and media plus the unwanted and unformatted text.How can I change this so the second echo statement just displays the images and embedded media?
- neferiu0
Some shit with PHP's preg functions...
- welded0
You've got the cart before the horse. Why can't you just start with separate variables instead of mushing everything together then trying to figure out how to separate them again?
- drgss0
welcome to the italic thread
- stewdio0
Italics. It's like the text is dancing. Or in a big hurry.
- uan0
italics :)
- MrDaro, did you check the manual?
http://ch2.php.net/m…
uan - even italics notes :)uan
- MrDaro, did you check the manual?
- airey0
what's going on here?
- lukus_W0
Oh dear .. we have a problem.
- spraycan0
still ?
- persona_non_grata0
wait
- persona_non_grata0
' fix?
- airey0
this thread is entirely peoples thoughts rather than the usual 'talking' we do in other threads. consider this thread a thought bubble.
- said the narrator.persona_non_grata
- 'thought' the narrator .airey
- bulletfactory0
I just wanted to see my username in italics.
aaahhhhhh.
It's the simple things in life.
- mikotondria30
</i> ? Did it work ?
- ckentish0
wow - loving this thread - italics have made all the difference - who would have thought PHP variable could be interesting!?
- dMullins0
LOL.
- moth0
interesting.
'</li>'Still?
- moth0
''</li>'
- mikotondria30
unescape(\'escape(\'html_entitie...
Just guessing, now.
- sherm0
well, i never
- juhls0
What a beautiful thread.