Jump to content

[SOLVED] Store string without the italic symbols


Recommended Posts

Hi

 

I recently experienced the following problem i would like your opinions or solutions about it....

 

I want to output a combined string to my website a string that consists of regular and italic letters. To do that i use the followung code

 

$NAME = $NAME.'<i>'.$detailsName.'</i>'

 

The string is created correctly and the output look like the this: Yamaha YZF R1

 

But when i try to store the variable $NAME in my database the value that is stored look like this: Yamaha<i>YZF R1</i>

 

Is there any way that i can store the variable name without the italic symbols... ???

 

Is there any way that i can store the variable name without the italic symbols... ???

 

Assuming the question is how to store it so it outputs what you want ...

 

$name = $name. " <em>". $detailsName. "</em>";

 

The i tag is deprecated, so use em instead.

I think we need a better description of the problem .. and possibly more than a single line of code if you're getting "the same problem" (which you don't really define).  Notice I forced a space in the string using   Did you?

Hi

 

I have the following code

$NAME = $NAME. " <em>". $detailsName. "</em>";

 

but the result in the field look like this

 

 

Yoshimura Full Exaust System  <em> (Colour: Carbon)</em>

 

I have enter the result in the code tags because i wanted to show the em symbols

If you have that code and what's stored in the database is what you say, then the actual variables $Name and $detailsName must have a trailing space and a leading space respectively.

 

It matters not how the data looks viewed in the database field, what matters surely is how it displays when echo'd out to the page.  For example:

 

<?php
$NAME = "Yoshimura Full Exhaust System";
$detailsName = "(Colour: Carbon)";
$NAME = $NAME. " <em>". $detailsName. "</em>";
echo $NAME;
?>[code]

[/code]

Because my system generates automatic email confirmations, i need to store the values without any symbols otherwise the symbols are presented to the confirmation email..

 

For example if a variable is stored in the database as

 

Yoshimura Full Exhaust System  <em> (Colour: Carbon)</em>

 

then the email sent to the user will present the ordered item as

Yoshimura Full Exhaust System  <em> (Colour: Carbon)</em>

 

They cannot recognize the em or any other symbols so they present them as characters.....  ???

 

erm why not just strip them out before using them in the email ? !!

<?php
$NAME  = strip_tags($NAME, '<br>') //if you wanna [b]keep[/b] the <br>
?>

also if the text is showing up in italics on the database, i am guessing that your viewing it via your browser

... then the email sent to the user will present the ordered item as ...

 

Sounds as though you need to modify the part of the script that defines the MIME type of the email so that it's an html email. In whatever system you have, surely that's some simple configuration switch.

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.