[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

uploading text file in to db?

Posted on 2002-04-16
5
Medium Priority
?
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 120 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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 i…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

650 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