PHP data processing

but none succeed

That is not good enough, you must try harder. No-one can help you if you just say "it doesn't work". You must be more precise in your description. What happened? What did you want or expect to happen? Were there any error messages? If so, what?

Perhaps if you look at my code that will give you some clues.