My idea is to use a textarea to let the user copy email name address etc…. to it.
The copied data must have delimiter between each value.
However, my questions are:
- How can i detect the delimiter used in copied data?
- How to manipulate? Store each into different array according to the location? but what if there is some error between eg. if one row has one more entry eg. email name address adress2 when other are email name address
Actually i am doing some process from outlook express export txt file or data copied from excel sheet
For those outlook express export file, there are some spacing for each email that without name .So the problem is occur eg.
aa@aa.com name1 bb@bb.com cc@cc.com name2
Thanks for your kindly help.
You would use explode for this (http://php.net/manual/en/function.explode.php).
If you can ask the users to enter each piece of data on a new line, you can then split the textarea contents by the \n character:
e.g.
Then each element of the array can be split by the delimiting comma:
Then validate the individual items that you’ve extracted from the delimited data as if they have come individually.