php-general Digest 14 Nov 2010 20:49:18 -0000 Issue 7036

2010-11-14 Thread php-general-digest-help
php-general Digest 14 Nov 2010 20:49:18 - Issue 7036 Topics (messages 309478 through 309480): Re: confusion about the file extension for php interpreter to interpret 309478 by: Sharl.Jimh.Tsin 309479 by: »ÝÐÂå· Re: String manipulation 309480 by: Ron Piggott

[PHP] Re: String manipulation

2010-11-14 Thread Ron Piggott
How would I write an IF statement that looks for the first space space (“ “) left of the 76th character in a string or br, which ever comes first --- OR the end of the string (IE the string is less than 76 characters long? I specifically want is it’s character position in the string. Ron The

Re: [PHP] Re: String manipulation

2010-11-14 Thread a...@ashleysheridan.co.uk
What about something like this: $pos = (strpos(' ', $string, 76))?strpos(' ',$string, 76):strlen($string); Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Ron Piggott ron.pigg...@actsministries.org Date: Sun, Nov 14, 2010 20:48 Subject: [PHP] Re: String manipulation

Re: [PHP] Re: String manipulation

2010-11-14 Thread D. Dante Lorenso
On 11/14/10 2:48 PM, Ron Piggott wrote: How would I write an IF statement that looks for the first space space (“ “) left of the 76th character in a string orbr, which ever comes first --- OR the end of the string (IE the string is less than 76 characters long? I specifically want is it’s

Re: [PHP] Re: String manipulation

2010-11-14 Thread Ron Piggott
I am receiving this error: Warning: strpos() [function.strpos]: Offset not contained in string I have never seen it before, what do I do? I made one change to it though, you didn’t have br in it before so I changed the syntax to: $pos = (strpos(' ', $activity_description_result,

[PHP] PHP loop to issue sql insert

2010-11-14 Thread Rick Dwyer
Hello List. I have a sql command that counts, groups and sorts data from a table. I need to insert the results of that sql command into different table. My sql SELECT looks like this: select count(*) as count, searchkeywords from searchtable group by searchkeywords order by count desc;

Re: [PHP] PHP loop to issue sql insert

2010-11-14 Thread Simon J Welsh
On 15/11/2010, at 12:47 PM, Rick Dwyer wrote: Hello List. I have a sql command that counts, groups and sorts data from a table. I need to insert the results of that sql command into different table. My sql SELECT looks like this: select count(*) as count, searchkeywords from

Re: [PHP] PHP loop to issue sql insert

2010-11-14 Thread Rick Dwyer
On Nov 14, 2010, at 8:15 PM, Simon J Welsh wrote: On 15/11/2010, at 12:47 PM, Rick Dwyer wrote: Hello List. I have a sql command that counts, groups and sorts data from a table. I need to insert the results of that sql command into different table. My sql SELECT looks like this:

[PHP] Returning values from a function

2010-11-14 Thread Ron Piggott
I am writing a string parsing function. I need to return 3 values from a function: return $string_to_display; return $string_to_parse; return $continue_parsing; I am not sure how to retrieve these variables. The Verse of the Day “Encouragement from God’s Word”

[PHP] Retrieving function values

2010-11-14 Thread Ron Piggott
I am writing a custom function and I need to be able to retrieve 3 values from it. string_parse_tool ( $string_to_parse ) The 3 variables I need to retrieve from the function are: $string_to_parse $string_to_display $continue_parsing I only know how to retrieve 1 variable from a function, not

Re: [PHP] Returning values from a function

2010-11-14 Thread 惠新宸
Hi: return array( 'string_to_display' = $string_to_display, . ); Best regards 惠新宸 Xinchen Hui http://www.laruence.com/ On 2010/11/15 11:10, Ron Piggott wrote: I am writing a string parsing function. I need to return 3 values from a function: return

Re: [PHP] Retrieving function values

2010-11-14 Thread Bastien Koert
On Sun, Nov 14, 2010 at 10:12 PM, Ron Piggott ron.pigg...@actsministries.org wrote: I am writing a custom function and I need to be able to retrieve 3 values from it. string_parse_tool ( $string_to_parse ) The 3 variables I need to retrieve from the function are: $string_to_parse

Re: [PHP] Retrieving function values

2010-11-14 Thread Tamara Temple
On Nov 14, 2010, at 9:12 PM, Ron Piggott wrote: I am writing a custom function and I need to be able to retrieve 3 values from it. To return multiple values, you have to return an array: return array($var1, $var2, $var3); Then at the calling site, you retrieve them with a list

Re: [PHP] Re: String manipulation

2010-11-14 Thread Tamara Temple
On Nov 14, 2010, at 4:48 PM, Ron Piggott wrote: Warning: strpos() [function.strpos]: Offset not contained in string Shouldn't you check the length of the string before giving it the offset? From: a...@ashleysheridan.co.uk $pos = (strpos(' ', $string, 76))?strpos(' ',$string,