Jump to content

total noob

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by total noob

  1. Thanks guys..
  2. I want to check the username name on the database everytime the user registers for a new account... When the user leaves the textbox then it will trigger to check if it is available or not... Can php do this without any help from javascript or jquery? thanks
  3. What is the best way to handle an auto database check? could php do this without the help of JQUERY or JAVASCRIPT?
  4. Wow... this is great! this is really what i need in order to finish my work... thank you so much for your help guys i really appreciate it.. God Bless!
  5. Hello again to all.. I have trouble of modifying this code.. A person gave me the link on where can i find answers to my problem on PHP String Parsing.. However it took me the whole weekend to modify the code.. I really have no idea on how to get the results that i want.. Could someone help me? This is the code <?php function parse_csv($file,$number,$comma=',',$quote='"',$newline="\n") { $db_quote = $quote . $quote; $file = trim($file); $file = str_replace("\r\n",$newline,$file); $file = str_replace($db_quote,'"',$file); $file = str_replace('#1#','',$file); $file = str_replace($number,'',$file); $file = str_replace($s++,'',$file); $file = str_replace(',",',',,',$file); $file .= $comma; $inquotes = false; $start_point = 0; $row = 0; for($i=0; $i<strlen($file); $i++) { $char = $file[$i]; if ($char == $quote) { if ($inquotes) { $inquotes = false; } else { $inquotes = true; } } if (($char == $comma or $char == $newline) and !$inquotes) { $cell = substr($file,$start_point,$i-$start_point); $cell = str_replace($quote,'',$cell); $cell = str_replace('"',$quote,$cell); $data[$row][] = $cell; $start_point = $i + 1; if ($char == $newline) { $row ++; } } } return $data; } $file ='#1# "4","+447980123456","+447781484145","","2009-06-08","10:38:15","hello "","" world","Orange" "5","+447980123456","+447781484146","","2009-07-08","10:38:55","hello world","Orange"'; $array = parse_csv($file,"+447980123456"); print_r($array); ?> This is the result of that code Array ( [0] => Array ( [0] => 4 [1] => [2] => +447781484145 [3] => [4] => 2009-06-08 [5] => 10:38:15 [6] => hello "," world [7] => Orange 5 [8] => [9] => +447781484146 [10] => [11] => 2009-07-08 [12] => 10:38:55 [13] => hello world [14] => Orange ) ) What i would like as the result is a string that shows this information.. Originator : +447781484145, Date : 2009-07-07, Time : 10:38:15, Message : hello world Originator : +447781484146, Date : 2009-07-08, Time : 10:38:55, Message : hello world Any help will be appreciated.. thanks in advance..
  6. Thanks sir.. I really appreciate you effort on helping me.. I think i will modify the code on the link that you give me.. thanks again
  7. Can you help me sir? thanks in advance
  8. The version on of my php on my cpanel is 5.2
  9. Hello guys.. I get an error.. Fatal error: Call to undefined function str_getcsv() in C:\wamp\www\a.php on line 4 Sorry for this but im not really that expert on using php.. Thanks again
  10. Hello to everyone Can someone help me on how to parse this CSV string? I do not know how to parse string using PHP.. #1# "4","+447980123456","+447781484145","","2009-07-08","10:38:15","hello "","" world","Orange" "5","+447980123456","+447781484146","","2009-07-08","10:38:55","hello world","Orange" This string can contain a much bigger data. I would like the result to be Originator : +447781484145, Date : 2009-07-07, Time : 10:38:15, Message : hello world Originator : +447781484146, Date : 2009-07-08, Time : 10:38:55, Message : hello world Please guys if anyone of you knows how to parse this string it will be much appreciated. Im nearing my deadline for my work and this thing is keeping me from finishing it.. Thanks in advance
×
×
  • 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.