Solved

uploading text file in to db?

Posted on 2002-04-16
5
206 Views
Last Modified: 2008-03-06
hi all,

while uploading in to text file, I try to display it on the browser.
my text file looks like
"WB00202105286","110","DBB110A.JED","Pass","MSWBT1","2/27/02","8:33:19"
I do like this.
$fcontents = file("/home/ftp/".$category."/".$filename);
for ($i = 0; $i < count($fcontents); $i++){
$p = explode(",",$fcontents[$i]);
     //where $fcontents is a file
by doing this way I can get rid of ,(comma's) but how t oget rid of "(double quotes).

this d.quotes I still get it when I try to display it.
can anyone help me out to solve the problem.
0
Comment
Question by:baska
5 Comments
 
LVL 4

Expert Comment

by:lokeshv
ID: 6944321
use str_replace..


Hope this helps

Lk
0
 
LVL 5

Expert Comment

by:andriv
ID: 6944964
You can use stripslashes function:

echo stripslashes($p);
0
 
LVL 5

Expert Comment

by:andriv
ID: 6944965
I'm wrong, I'm thinking of slashes for quotes.
0
 
LVL 8

Accepted Solution

by:
us111 earned 30 total points
ID: 6947242
$a='"WB00202105286","110","DBB110A.JED","Pass","MSWBT1","2/27/02","8:33:19"';
$a = split("[\",]", $a);
for ($i=1;$i<count($a);$i=$i+3)
  print " $a[$i]";
0
 

Author Comment

by:baska
ID: 6959398
Thanks us111,

it works exactly as I want it.

bye
baska




0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
.htaccess file settings 4 36
PHP string issue 5 17
Showing data from 2 sql queries in one dropdown 8 13
PHP JSON Clean up 5 6
Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now