473,379 Members | 1,255 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,379 software developers and data experts.

Does an array contain an element?

Hi,

I'm using PHP 4.4.4. Is there a shorter way to check if an array has
an element besides doing a for loop and iterating through each element?

Thanks, - Dave

Dec 4 '06 #1
1 1509
..oO(la***********@zipmail.com)
>I'm using PHP 4.4.4. Is there a shorter way to check if an array has
an element besides doing a for loop and iterating through each element?
http://www.php.net/in_array

Micha
Dec 4 '06 #2

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

Similar topics

4
by: Glutinous | last post by:
I've been studying this for hours, searching the www & usenet, and still can't figure out why 'each' returns an array of four key/value pairs, when it looks like just two pairs would suffice... ...
2
by: Dave Smithz | last post by:
Hi there. Because of the lack of a Union query in MySQL 3 I have decided to take the approach where I populate two arrays with values from similar tables in DB. In this case they are `courses`...
2
by: A | last post by:
Hi, consider the following code: int i = new int; myArray* a = new myArray; question: sometimes you need to initialise all elements in an array to 0 (eg using a for loop) before you can...
8
by: Peter B. Steiger | last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C is a simple word game that involves stringing together random lists of words. In the Pascal version the whole array was...
5
by: yogesh | last post by:
Why does the following code gives an error. char c="sometext"; char **cp = &c; This gives the error "can not covert from char (*) to char**; But when i change the code to char...
15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
3
by: John Espinosa | last post by:
I am new to C#. I am trying to use a for loop of integers to fill up a String array. Actually, I am trying to get a dropdown list of all the days in the current month. This is what I have been...
5
by: chandanlinster | last post by:
consider the program, /*********************************************************/ int main() { int a; printf("a = %u\n", a); printf("*a = %u\n", *a); return 0; }
1
by: kamleshsharmadts | last post by:
I am using Ajax with struts in web application. from jsp i am calling a function of ajax.js onclick of a button. code of that call function which calling from jsp given as below:- ...
3
by: Hallvard B Furuseth | last post by:
to find the required alignment of a struct, I've used #include <stddef.h> struct Align_helper { char dummy; struct S align; }; enum { S_alignment = offsetof(struct Align_helper, align) };
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.