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, 76):str

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 co

Re: [PHP] Retrieving function values

2010-11-14 Thread Bastien Koert
On Sun, Nov 14, 2010 at 10:12 PM, Ron Piggott 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 > $string_to_display > $continu

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 $string_to_display

[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

[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” http://www.TheVerseOfTheDay.info

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: sel

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

[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] 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 in it before so I changed the syntax to: $pos = (strpos(' ', $activity_description_result, 76))?strpos('',

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 or, 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 charac

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" Date: Sun, Nov 14, 2010 20:48 Subject: [PHP] Re: String manipulation To: How would I write an I

[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 , 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 Ve