Jump to content

Recommended Posts

How do I put line breaks (so Descript1b, 1c and 1d are on different lines) in the following code:

 

<?php echo "<td class=\"{$class1}\">"; echo $info["Descript1a"]; echo $info["Descript1b"]; echo $info["Descript1c"]; echo $info["Descript1d"]; ?><!-- Col 2 -->

 

I tried <br />, "<br /">, \r\n and various other thinks, thanks....

 

Also, the descript field has a dollar sign that does not print out, how do I do that too...

Add in a <br />.

 

<?php echo "<td class=\"{$class1}\">" . $info["Descript1a"] . "<br />" . $info["Descript1b"] . "<br />" . $info["Descript1c"] . "<br />" . $info["Descript1d"]; ?><!-- Col 2 -->

 

Edit: With so many <br />s, I should have used a delimited print function. *sighs*

Try...

 

<?php
echo "<td class=\"{$class1}\">";
echo $info["Descript1a"] . '<br />';
echo $info["Descript1b"] . '<br />';
echo $info["Descript1c"] . '<br />';
echo $info["Descript1d"] . '<br />'; ?>
<!-- Col 2 -->

 

Which 'descript' field do you mean?

 

If it's (for example) 'Descript1a' you can use:

 

echo str_replace('$', '& #36;', $info["Descript1a"]) . '<br />';

 

Or to apply to them all you could use something like:

 

foreach ($info as $key => $val)
{
    $info[$key] = str_replace('$', '& #36;', $val);
}

 

Edit: The html entities shouldn't have a space after the ampersand though!

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.