How to combine the records of the corresponding number in excel with php into one sentence

Source: Internet
Author: User
How can I use php to output the corresponding records in the excel file into a single sentence Array ([content] => Doctor [record] => Hello, here, you can make an appointment with Professor Zheng farei of Peking Union Medical College Hospital. you can leave a phone number, name, and age to learn more about your medical history.) Array ([content] => patient [record] => Hello) array ([content] => patient [record] => my child experienced hematuria on Friday after a kidney puncture on Wednesday. until now, there has been hematuria, and the urine color is flesh-washed, what should I do?) Array ([content] => Doctor [record] => Are you still in the hospital?) Array ([content] => Doctor [record] => the doctor should take hemostatic treatment) array ([content] => Doctor [record] => Hello, don't worry. if typing is inconvenient, leave a contact number for you, I will call you back for details later, so that you will receive the call for free.) Array ([content] => Doctor [record] => What about kidney clothing made in that hospital, why do we need to wear kidney due to such a large side effect?) Array ([content] => Doctor [record] => Are you still there) array ([content] => patient [record] => in Hangzhou Children's Hospital) Array ([content] => Doctor [record] => How old is the child? the diagnosis is nephritis, still Kidney!) Array ([content] => Doctor [record] => I think you are typing slowly. if it is convenient, you can leave a call. I will give you a call to guide you, I am on duty today.) Array ([content] => patient [record] => 13586138126) Array ([content] => Doctor [record] => OK, how do I call you? is it convenient to answer the call now? Array ([content] => patient [record] => Miss Li) array ([content] => patient [record] => convenient) Array ([content] => Doctor [record] => wait a moment)


Reply to discussion (solution)

Isn't it just traversing the array as a string link?

You are a mess, except who knows, who knows who is who

Well, I cannot express it clearly.
$ Connect = mysql_connect ("localhost", "root", "root ");
If (! $ Connect ){
Die ('could not connect: '. mysql_error ());
}
// Connect to the database (excel)
Mysql_select_db ("excel", $ connect );
// Adjust the encoding
Mysql_query ("set names GBK ");
$ Array = array ('Google ', 'Chrome', 'Android', 'YouTube ', 'Gmail ');
// Use the for loop to traverse the array elements. count () is used to calculate the length of the array.
For ($ I = 0; $ I // Print the value of an array element =
$ Yy = $ array [$ I];
/*
I want to add the characters in these arrays to the database as a paragraph, that is, as a complete field.
The result of echo $ yy is GoogleChromeAndroidYoutubeGmail.
Then execute the SQL statement insert into work (chats) values ('Google ') insert into work (chats) values ('chromi') insert into work (chats) values ('Android ') insert into work (chats) values ('YouTube ') insert into work (chats) values ('Gmail') is not what it is like:
Insert into work (chats) values ('googlechromeandroidyoutubegmail ');
*/
$ SQL = "insert into work (chats) values ('$ yy ')";
Echo $ SQL;
// Echo $ yy;
}
?>

$ Yy = ''; for ($ I = 0; $ I
  
  

Thank you. if I want to combine the values in multiple array () arrays into one sentence, for example, Array ([0] => Doctor [1] => Hello) array ([0] => patient [1] => Hello) how to combine them into one sentence output doctor: Hello! Patient: Hello! Format

Then you can paste the array output with var_export.
And points out the items to be merged.

How can this problem be solved? an Array output is in the following format: Array ([0] => Hello, doctor. you can reserve an appointment with Professor Zheng farei from Peking Union Medical College Hospital, you can leave your phone number, name, and age. let's take a look at your medical history. ) Array ([0] => Hello, patient) Array ([0] => patient my child had hematuria on Friday after kidney punction on Wednesday, until now there has been hematuria, what should I do if my urine is washed with meat? ) Array ([0] => is the doctor still in the hospital?) Array ([0] => the doctor should take the hemostatic treatment) array ([0] => Hello, doctor. please do not worry. if you cannot type your phone number, you can leave a contact number for you. you can call back to answer your questions for free later) array ([0] => What about kidney wear performed by a doctor in that hospital? why is kidney wear caused by such a large side effect?) Array ([0] => is the doctor still there) array ([0] => the patient is at Hangzhou children's hospital.) Array ([0] => How old is the doctor's child? is the diagnosis of nephritis or kidney deficiency) array ([0] => doctor, I think you are typing slowly. if it is convenient, you can leave a call. I will give you a call to guide you. I am on duty today) array ([0] => patient 13586138126) Array ([0] => Hello, doctor. what do I call you? is it convenient to answer the call now) array ([0] => Patient Miss Li) Array ([0] => patient convenience) Array ([0] => doctor waits for a moment) then I want to combine these into a sentence to understand them in this way.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.