Re: remove characters, add newline & making a twodimensional array

From: Date: Wed, 25 Jun 2003 10:38:35 +0000
Subject: Re: remove characters, add newline & making a twodimensional array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-152735@lists.php.net to get a copy of this message
Dore van Hoorn wrote:
Well, i'm kind of a newby, but this is what i would like to do in php: 1. i'm writing all instances of a mysql table to a txt file, but when i add "\n" to go on on the next line, in the txt file there is a square printed. When i try to import the txt file into ms access, the square is not recognized by this program to represent a newline.. how can i add a newline to a txt file, that actually IS a newline (or better: hard return) and that will be recognized as one, when reading the file into another program? Newline in dos/windows text files is "\r\n"
2. a array contains a string of text, multiple words and interpunction. my first question: how can i remove the interpunction ( i know how to strip slashes and trim spaces..)?
strtr() -- cantains also an example secondly, after this, i would like to count all double
entries. f.e. when the word computer occurs twice in the sentence, i would like to make an array that is twodimensional: word-number of occurences (f.e. 'computer' '2'). How do i do that, for i don't really understand the phpmanual-explanation about this topic. And thirdly: how do i get both facts (word and number) out of the array? (all this has to produce a word-frequecylist, so if anybody has a clue how to do that......)
First you need to get and array of all words - use explode() or preg_split(). Then you need to loop the array and count the words.
3. how can i upload an image to my server and then call the image back into a webpage, just by using php?
http://www.php.net/manual/en/features.file-upload.php
+++++++++++++++++++++++++++++++++++
N    Dore van Hoorn
S    s1000454 AlfaInformatica-RuG
E    M.D.van.Hoorn@student.rug.nl
W    http://www.let.rug.nl/~s1000454
+++++++++++++++++++++++++++++++++++


« previous php.general (#152735) next »