开发者

Array of all subjects

i want two arrays first one of all subjects and the second of all degrees which study in all universities (all over the world)

But a big problem is that i dont know how many subjects and how many

degree are there.? (in all over the world)

I just want two array the remaining logic i have made already.

All subject array list must be like.

$subject[0]=>'Computer Science',
$subject[1]=>'Mathematics',
$subject[2]=>'Engineering',
$subject[3]=>'Physics',
...

And 开发者_如何学编程secondly array of all degrees must be like.

$degree[0]=>'BS',
$degree[1]=>'MS',
$degree[2]=>'BA',
$degree[3]=>'MA',
...

Keep in mind that **

I dont know how many subjects and how many degree are there.? (in all over the world)..

**

I just want these two categories in two individual array & thats all....

Could any one help me.? Thanks.


Your problem appears to be twofold; there's the issue of getting hold of the data, and the issue of storing it in a manner which allows effective retrieval and use.

Obtaining the data is likely to be your biggest problem; you're literally asking for information about every institution in the world (or at least, as many as you can get). The available qualifications and nomenclature varies widely between different countries, and the list of courses at any given institution is going to be vast.

Finding a single decent, machine-readable source for this information is probably not going to happen. Your best bet would be to try and find multiple sources, but I'm struggling to think of any really good ones off the top of my head, and Google isn't looking too promising. You could attempt to scrape data from sites such as the Universities and Colleges Admissions Service (the UK body which basically catalogues higher education) - I've linked to their "course list" pages. Whether similar bodies (and similar data sets) exist for other regions, I've no idea.

The second problem is quite straightforward; you're going to have a ton of data, so you'll need to store it in a database. Then again, it's not that straightforward. Presumably, you want to catalogue courses by institution, and institutions by country, so make sure you normalise the data a little. You'll probably need to do some work to identify equivalent degree grades (as mentioned above) between different countries.


I don't understand exactly your question. But if you're trying to fetch records from your database and deposit 'em into an array, mysql_fetch_array() is what you need: http://php.net/mysql_fetch_array


As far as i could understand your question, you need to know how to store subjects in an array. See arrays in php. If you are looking for storing your subjects in database then see php and mysql tutorial. Because you want to store unknown number of subjects and degrees, don't use something like:

$subject[0]=>'Computer Science',
$subject[1]=>'Mathematics',
$subject[2]=>'Engineering',
$subject[3]=>'Physics',

Instead use:

$subject[]=>'Computer Science',
$subject[]=>'Mathematics',
$subject[]=>'Engineering',
$subject[]=>'Physics',

This will add subjects to the array without your puting index manually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜