robcrozier Posted August 15, 2008 Share Posted August 15, 2008 Hi Guys, i'm using Joomla for a current project and theres one certain sentence that does Joomla has not wrapped with sufficient tags in order to let me style it in the CSS. I'm therefore trying to discover how i might go about finding this sentence using PHP (i know what the full sentence is) and then wrap <p></p> tags around it. I can then also include a class in the tags and thus use CSS to style the sentence. Any help would be great, cheers! Quote Link to comment https://forums.phpfreaks.com/topic/119803-wrapping-a-sentence-with-tags/ Share on other sites More sharing options...
MasterACE14 Posted August 15, 2008 Share Posted August 15, 2008 <?php $paragraph = <<<_PARA <p style="color: white; background: black;"> {$text} </p> _PARA; echo $paragraph; ?> Quote Link to comment https://forums.phpfreaks.com/topic/119803-wrapping-a-sentence-with-tags/#findComment-617193 Share on other sites More sharing options...
robcrozier Posted August 15, 2008 Author Share Posted August 15, 2008 Thanks for that MasterACE14, however, will that code actually find the relevant text in the document, without the text referencing it (e.g. like a function or something)? It's Joomla thats actually generating the code from the database on the fly you see. So i cant actually link that sentence to the php code that you have just supplied. Or can i? Any further assistance would be appreciated. Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/119803-wrapping-a-sentence-with-tags/#findComment-617207 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.