Jump to content

[SOLVED] 2 basic questions . . .


itdmacar

Recommended Posts

HI,

 

1 ) How do I make my text smaller in my option value ? It using the standard size, is it possible to change the size text ?

 

            <option value="<?php echo $_SESSION['lnktown']; ?>"><?php echo $_SESSION['lnktown']; ?></option>

 

2) I have a header input field but whenever the text contains '  e.g. Ronald's, my script is failing due to that '

 

    I did tried to remove it by  dong this  $valheader = strip_tags(trim($value)); still failing

 

            how to convert from  Ronald's  to  Ronalds

 

Thanks in advance . . .

 

Link to comment
https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/
Share on other sites

1 ) How do I make my text smaller in my option value ? It using the standard size, is it possible to change the size text ?

 

Yes. You should use Cascading Style Sheets (CSS).

 

2) You shouldn't need to remove single quotes to make your code work, but if you want to remove single quotes, try

 

str_replace("'","",$value);

2) U can use str_replace() as suggested to completely remove the ', but also u can consider adding and stripping slashes:

 

<?php
$name = "Ronald's";
$name = addslashes($name);
echo $name; //will output: Ronald\'s
?>

 

In this way ull not have problems with database queries and stuff. To strip those slashes and return the string to original u use stripslashes():

 

echo stripslashes($name); //will produce: Ronald's

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.