How to read incoming csv text data to PHP page and display it

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Learner
New php-forum User
New php-forum User
Posts: 2
Joined: Sun Jan 13, 2019 6:42 pm

Sun Jan 13, 2019 6:51 pm

Before being able to process some incoming data to a PHP page, I need to resolve the problem of HOW to simply have the csv text data line accepted and display it (echo).

<?php

(PSUEDO CODE)

1. Receive incoming csv text data line from a Java APP upload (NOT to worry about parsing the file yet)

2. Simply display the full incoming (short) csv text test data line (text1, text2,text3,text4) using echo.

?>

I have tried multiple code snippets with php://input, fgetcsv, etc. but can NOT get anything to work.

This has been driving me NUTS !!!

Thanks for any assistance.

- Learner

Learner
New php-forum User
New php-forum User
Posts: 2
Joined: Sun Jan 13, 2019 6:42 pm

Sun Jan 13, 2019 9:12 pm

Finally .. this at least works as a starting point and verified the data is received:

$entityBody = file_get_contents('php://input');

AJphp
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Jan 17, 2019 5:14 am

Thu Jan 17, 2019 6:56 am

To clear-up: The data is getting upload by a human user?
Or is it a direct upload from your java application?

chorn
php-forum Fan User
php-forum Fan User
Posts: 584
Joined: Fri Apr 01, 2016 2:18 am

Thu Jan 17, 2019 11:31 pm

so you have a solution now, is there any problem left?

Post Reply