counting characters

prophoto

Active Member
I have a new project coming up which will require the form to count characters in a text area box in order to calculate total cost, how would I accomplish this?
 
ah missed the bit about the total cost, so your calculation element might have some PHP code as follows:

PHP:
$costPerWord = 0.1;
$text = '{table___textarea}';
$words = explode(' ', $text);
$cost = count($words) * $costPerWord;
 
return $cost;
 
Try ...

PHP:
$costPerWord = 0.1;
$text = '{table___textarea}';
$cost = mb_strlen($text) * $costPerWord;
 
return $cost;

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top