Jump to content

[SOLVED] strlen help


dennismonsewicz

Recommended Posts

I have a script that reads the length of a string coming out of a database and based on the length is how long the input field is to edit that particular field. But the problem i am having is its not accurately sizing the input field correctly

 

$testimonialLength = strlen($row->testimonial);

 

Any ideas?

 

The input is like this:

 

<input class="inputbox" type="text" name="testimonial" id="testimonial" size="<?php echo $testimonialLength; ?>" value="<?php echo $row->testimonial; ?>" />

Link to comment
https://forums.phpfreaks.com/topic/138793-solved-strlen-help/
Share on other sites

Yeah.  You might want to use CSS if you want to more accurately control the width of the text box.

 

<input class="inputbox" type="text" name="testimonial" id="testimonial" style=width: "<?php echo $testimonialLength * 12; ?>px" value="<?php echo $row->testimonial; ?>" />

Link to comment
https://forums.phpfreaks.com/topic/138793-solved-strlen-help/#findComment-725728
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.