RE: [PHP] HELP!!! Word count

2002-07-11 Thread Shane

Dan, if you are entering the words in a form, when the variable holding the string 
hits your script do something like this (Hey I just figured this out myself too

Gotta love these lists

$tmpStr= whatever the form passes your script
// turn string into an array
// use EXPLODE() to seperate the words into an array
// since they are seperated by a " " (blank space)
$tmpAry = explode(' ',$tmpStr);
// if they were seperated by commas you would write
$tmpAry = explode(',',$tmpStr); // DIG
// then just use count($tmpAry) to figure out the size of your array
// and you have the number of words!

There might be an easier way than that, but it workes for me.
-Peace dude
PS: Thank Andrew Braund for the solution, he sent a varriant of it to me

That's two people you helpes Andrew!
YOU RULE!!!

- NorthBayShane
-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 6:20 PM
To: Dan McCullough; PHP General List
Subject: RE: [PHP] HELP!!! Word count


if i remember correctly there was something on word counts posted in the last week or 
or .. maybe even last couple days... have a scroll thru and u will find it :)

> -Original Message-
> From: Dan McCullough [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 12 July 2002 11:08 AM
> To: PHP General List
> Subject: [PHP] HELP!!! Word count
> 
> 
> I have some clients who want to charge a flat rate for words 
> entered, but over a certain number of
> words there is an additional charge, to complicate matters there 
> is an option/addon where you can
> bold the lines, and there is a charge per line, so you have to 
> calculate the total number of lines
> based on character total.
> 
> Anyone know of way to accomplish this, I know that it will have 
> to be done in seperate ways.  but
> does anyone have an idea or two .. hlp 
> 
> thanks,
> 
> dan
> 
> __
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] HELP!!! Word count

2002-07-11 Thread John Holmes

You can use explode() to split the text up into words, and then count
them up. You can use strlen() or substr() or something to see how many
"lines" there are...whatever you define a line as. Look up other useful
functions at http://www.php.net/manual/en/ref.strings.php. 

I really think you'd be best off with a human deciding these things,
though, maybe with a little PHP help. If you make it all automated,
what's stopping me from posting
1997_White_Chevy_S10_Loaded_Power_Everything_$2000_Call_555-1212_for_inf
o and only being charged 1 cent for it??

---John Holmes...

> -Original Message-
> From: Dan McCullough [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 11, 2002 9:08 PM
> To: PHP General List
> Subject: [PHP] HELP!!! Word count
> 
> I have some clients who want to charge a flat rate for words entered,
but
> over a certain number of
> words there is an additional charge, to complicate matters there is an
> option/addon where you can
> bold the lines, and there is a charge per line, so you have to
calculate
> the total number of lines
> based on character total.
> 
> Anyone know of way to accomplish this, I know that it will have to be
done
> in seperate ways.  but
> does anyone have an idea or two .. hlp
> 
> thanks,
> 
> dan
> 
> __
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] HELP!!! Word count

2002-07-11 Thread Peter

if i remember correctly there was something on word counts posted in the last week or 
or .. maybe even last couple days... have a scroll thru and u will find it :)

> -Original Message-
> From: Dan McCullough [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 12 July 2002 11:08 AM
> To: PHP General List
> Subject: [PHP] HELP!!! Word count
> 
> 
> I have some clients who want to charge a flat rate for words 
> entered, but over a certain number of
> words there is an additional charge, to complicate matters there 
> is an option/addon where you can
> bold the lines, and there is a charge per line, so you have to 
> calculate the total number of lines
> based on character total.
> 
> Anyone know of way to accomplish this, I know that it will have 
> to be done in seperate ways.  but
> does anyone have an idea or two .. hlp 
> 
> thanks,
> 
> dan
> 
> __
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>