Jump to content

ddrake1984

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by ddrake1984

  1. apologies Zane if I offended you, or rythemton and dragon_sa. I did not mean to use and abuse if that is what was seen. I only asked for some assistance with php and how to do a split in a string. I also don't expect this to be a race or method comparison. but I have tried to understand the errors and I am having difficulty. rythemton, your solution worked like a charm, I could kiss you.
  2. rythemton your script unfortunately didnt work. I have this error Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\index.php on line 52 dragon_sa yours worked but only one string worked. there was an error after the first string. Fatal error: Cannot redeclare splitByCaps() (previously declared in C:\xampp\htdocs\index.php:51) in C:\xampp\htdocs\index.php on line 51 my code is: while(odbc_fetch_row($sqlresult_products)) { echo "<tr>"; echo "<td><font size=1 face=verdana><b>"; $string = substr($phpresult_vendors,9,-9); function splitByCaps($string){ return preg_replace('/([a-z0-9])?([A-Z])/','$1 $2',$string); } echo splitByCaps($string); for the purpose of understanding the above script a bit better $phpresult_vendors are 'Products_IngramMicro_Products' 'Products_ExpressData_Products' 'Products_TheAmazingCompany_Products" etc.
  3. I need to split a string, but in a very unusual way. $string1 = "HelloWorld" $string2 = "AlphaBravo" $string3 = "BreakMeUp" I need the following split at each upppercase letter for this output Hello World Alpha Bravo Break Me Up
×
×
  • 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.