RE: [PHP-DB] getting one line of info at a time

From: Date: Mon, 12 Apr 2004 21:27:01 +0000
Subject: RE: [PHP-DB] getting one line of info at a time
Groups: php.db 
Request: Send a blank email to php-db+get-33855@lists.php.net to get a copy of this message
Ooops, got lost in the thought.... $text_area = $_POST[ "textarea" ]; $str = strtok( $text_area, "\o" ); while( !( $str === FALSE )) { $text_array[] = $str; } for( $i = 0; $i < count( $text_array ); $i++ ) { for( $j = 0; $j < stlen( $text_array[ $i ]) { $char = substr( $array_elelment[ $i ], $j ); printf( $char ); } -----Original Message----- From: Galbreath, Mark A Sent: Monday, April 12, 2004 5:06 PM To: 'Hull, Douglas D'; 'Note To php mysql List (E-mail)' Subject: RE: [PHP-DB] getting one line of info at a time Find out what the hex is for a carriage return and use strtok() to get an array of words, then use strlen to get the number of chars in each array element, and use array_pop() or array_shift(), iterating over the strlen, or test for NULL for each element in the array.. Mark -----Original Message----- From: Hull, Douglas D [mailto:ddhull@ku.edu] Sent: Monday, April 12, 2004 4:45 PM To: Note To php mysql List (E-mail) Subject: [PHP-DB] getting one line of info at a time 1. I have a regular html textarea field for a person to enter in words with a carriage return after each word. In PHP how would I go about getting one line (or word) at a time? Then I will be needing to get character by character. 2. I will then be searching my database to get matching values in order to do other things. But at the moment I am jus trying to figure #1 out. Thanks for any help. Doug -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#33855) next »