473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

parsing words

I have an array and I want to fetch it and get each values that starts
with "col" in the array and do something with them, how can I do that?
Jul 17 '05 #1
3 1473
I noticed that Message-ID:
<39**************************@posting.google.com > from
ki*********@yahoo.com contained the following:
I have an array and I want to fetch it and get each values that starts
with "col" in the array and do something with them, how can I do that?


For each value in the array use substr() to see if the first three
letters =="col"
http://uk2.php.net/manual/en/function.substr.php

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
ki*********@yahoo.com wrote:
I have an array and I want to fetch it and get each values that starts
with "col" in the array and do something with them, how can I do that?

array_filter() or even better, array_keys() with optional value.
http://ch.php.net/manual/en/function.array-keys.php

Aphrael.
--
"La demande mondiale d’ordinateurs n’excédera pas cinq machines."
(Thomas Watson, Fondateur d'IBM, 1945)
Jul 17 '05 #3
ki*********@yahoo.com wrote in message news:<39**************************@posting.google. com>...
I have an array and I want to fetch it and get each values that starts
with "col" in the array and do something with them, how can I do that?


let $array be your array

foreach ($array as $i => $value) {
$line = $array[$i];
$tok = strtok($string," \n\t");
if($tok == "col")
do something
}
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fuzzyman | last post by:
I want to parse some text and generate an output that is similar but not identical to the input. The string I produce will be of similar length to the input string - but a bit longer. I'm...
8
by: Anders Eriksson | last post by:
Hello! I want to extract some info from a some specific HTML pages, Microsofts International Word list (e.g. http://msdn.microsoft.com/library/en-us/dnwue/html/swe_word_list.htm). I want to...
19
by: ARK | last post by:
I am writing a search program in ASP(VBScript). The user can enter keywords and press submit. The user can separate the keywords by spaces and/or commas and key words may contain plain words,...
4
by: meldrape | last post by:
Hello, I need to parse a long string into no more than 30 character chunks, but I also need to leave the words intact. Right now, I am using: For intStart = 1 to Len(strOriginal) by 30...
2
by: JaythePCguy | last post by:
Hi, I am trying to write a text parser to group all nonprintable and control characters, spaces and space delimited words in different groups using Regex class. Using a parsing of...
4
by: william | last post by:
Hello, I've imported an excel spreadsheet with a Name column which is formatted as Last, First, MI. Some examples I have in the Name column: Smith, Ellen P. Jones, Mary Jane...
1
by: kellysgirl | last post by:
Im not good at parsing strings....and Ive been driving myslef nuts This is what I need to do....use an if/else statement to validate thata delimeter has been selected. These delimeters being...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
2
by: 1983pramod | last post by:
I am having a line of 100 words. I need output like this first 6 words Newline Next 6 words newline Next 6 words ... Can anyone help me on this.
2
by: DCDeshpande | last post by:
Hi, I am new to Java and need to parse a simple txt file into unique tokens and store them in a data structure. Can someone please recommend the most efficient way to do this? I found out that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.