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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.