Jump to content

string manipulation


dzisaacs

Recommended Posts

I think you are referring to how this displays on the screen; i.e. you get Hello and then world on the next line. This is indeed a html issue - h1 and p tags are block level so they will clear to the next avilable line within the current element.

If that is the html you are outputting then you will have to change the display properties of h1 and p in your style sheet to:

h1 , p {
display: inline;
}

That will put it on one line BUT you will not have a space between words...
Link to comment
https://forums.phpfreaks.com/topic/30697-string-manipulation/#findComment-141439
Share on other sites

// i read this variable from the DB
$message = $db_Message

// i pass it to a function
echo "function($message)";

------

in the HTML it gets displayed like this

function('<H1>Hello</H1>
<P><FONT color=#ff0000>World</FONT></P>')

obviously this doesn't work for me because i need it to be like this


function('<H1>Hello</H1><P><FONT color=#ff0000>World</FONT></P>')

i need to do some manipulation in $message = $db_Message to have the string in this way <H1>Hello</H1><P><FONT color=#ff0000>World</FONT></P>
not this way
<H1>Hello</H1>
<P><FONT color=#ff0000>World</FONT></P>

any ideas?
Link to comment
https://forums.phpfreaks.com/topic/30697-string-manipulation/#findComment-141574
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.