State list of world with country-code [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Where can I found the list of all the states of world with their country code (ISO2 or ISO3).
I have to insert all these states in my database. If the list is available in the .sql will be great.
I need state list of world with country-code not the country list.
Do you know where can I found?
Thanks in Advance.

http://www.timdavis.com.au/data/
There is a link to a excel spreadsheet of all the country and state information.

Wikipedia has the full list of both 2-letter and 3-letter country codes:
http://en.wikipedia.org/wiki/ISO_3166-1
With regards to having it in a local DB table, note that this list does occasionally change as nations are created, renamed or merged, so although it's not very frequent, you do need to keep it up-to-date, and also importantly, know what you're going to do with codes which become obsolete (ie if you've got cross-references to it from other tables, you can't just delete a record without making the cross-references invalid)
[EDIT]
You comment that you're looking for a state list.
This phrase "state list" is confusing. Are you using the word "state" as its used in the US. Other countries would refer to those as provinces, regions, counties, cantons, or a range of other terms.
More importantly, very few countries have codes for their individual regions.
For example, the UK is broken into counties such as Yorkshire, Hampshire and Surrey, but there aren't any codes that map to these names. There are short abbreviated versions of some of the names (ie 'Hants'=='Hampshire'), but they're colloquial abbreviations; certainly not official. There are also UK postcodes which do provide codes for areas, but these do not map to named counties. And other countries don't even have that.

This has annoyed me too. My issue is I can never find states to match countries. I created this for people to use. Its in YAML format, I generated python and javascript versions. I also generated an alternate array.
https://github.com/niall-oc/minimax

Search google for: php country abbreviations list
Here's the first link: http://27.org/isocountrylist/

http://www.timdavis.com.au/data/
Interesting data for Country & states.
Download excel from here correct the state names and import into your database and use.

You can get the SQL Scripts from this post:
SQL Scripts

Related

Automated Script to Visit URLs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am creating a simple web application using PHP, Codeigniter and Google Books (on an WIndows 7 XAMPP localhost environment).
I have a MySQL list of books (a few hundred) and corresponding ISBN numbers. When a user views a book / visits a URL for the first time, and API call is made to Google Books and the title, author and description of the book is saved to my database.
Ideally i'd like to populate the database myself and not rely on the user. So, I was thinking of visiting each URL manually. However there a lot of items!
Is there a script I can use for such a task? I was hoping to run the script once every 5 minutes over a 24 hour period.
My URL is in the following format:
/items/itemView/1 // <-- book 1
/items/itemView/2 // <-- book 2
/items/itemView/3 // <-- book 3
// etc
// etc
Thanks
Short Answer:
A storage API exists so you don't have to catalogue everything.
Long Answer:
It sounds like what you are trying to do is take the API and scour through every single entry and record them for your own purposes.
While this can usually done fairly simply, instead of telling you how to do this, I'm going to tell you why you shouldn't.
An API to a huge database exists so that you don't have to store it all, as the resources required can be absolutely huge, usually more than most enthusiasts would even have.
It's better to have it as you do now, cache what is visited on the chance it is visited again and make sure periodically that any records you DO keep, you compare to it's source so that you don't have an out-of-date record (another pitfall of local caching).
I hope this helps at least show you why people tend not to duplicate large data sources.

PHP validating and filtering a list of international numbers so im left only with valid cellphone numbers from that country [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am building a tool that will validate and filter a list of numbers from csv/xlsx.
filter all non cellular.
validate that its indeed a cellular number from a chosen country (maybe dynamicaly).
tried google's libphonenumber but i realy didnt understand how to implement it.
please help with a basic regex so i can modify it with different country codes.
That problem is REALLY complex, and it is not always resolvable.
For example, while most (all?) European countries have separate prefixes for mobile numbers, that's not true in the NANPA region (US, Canada and others). Indeed, landlines and mobile numbers share the same geographical prefix, and there's absolutely no way to distinguish them.
Google's libphonenumber is actually great, and it contains the data for each country. For most countries it also includes methods to distinguish between mobile numbers and landlines, when it's possible (for NANPA, it always returns the "landline or mobile" constant). I've used that library for many projects, and it's really good (I've also contributed to it).
However, libphonenumber is officially available only for C/C++, Java and JavaScript, so you can't really execute it with PHP code. There's an UNOFFICIAL PHP port available, which seems also pretty updated, but I do not know how well it works. Docs and examples are available there too.
(Eventually, however, the biggest value in libphonenumber is in the data tables, the rest is just "companion code").
Well first of all you have to know all the number formats.....You could possibly use preg_matchto find like + in front of the number or () etc. Then I would explode first two numbers which most likely would be country code numbers.....then just do if statements that would look at these two numbers and based on what these numbers are decide what country is the number from.

php email management and Event management [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a client that has a list of several thousand email addresses (and their personal info). If they are holding an event in a particular city, they want to send an email to "everyone in these cities with these parameters". They would like to keep track of who attends each event, let people unsubscribe, but not loose their data, track other attributes about each person over time, etc.
The main company site is in Drupal, but this project can use any platform. Any suggestions about php software that can be customized to do this?
There is heaps of software to do this. You will have to get the data into a form that can be imported into a database though like mysql.
Wordpress has lots of plugins that can import mailing lists and news letters.
Once the data is in a database table then you could also write your own quite easily. If you aren't a coder though wordpress plugins or something similar might be the way to go.
Also, checkout mailchimp and services like that.
p.s. if you send several thousands emails you will probably get black listed :P
Obviously there is lots of software to do this, but I was looking for any advice someone might have to help me narrow down the search because there are so many scripts to test.
In this case, I settled on CiviCRM, which has both a drupal and a wordpress integration and does everything that I needed, specifically the ability to record lots of meta data about the individuals in the database and then to segment that data to use for sending email.
https://civicrm.org/

Open Source Reporting and Analytics for PHP (Logistics) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
We're a small logistics company and want to be able to provide clients with a way to generate custom reports with their data in our shared database (limited by the relations built in the DB) as well a few standard reports that we will build for them.
We've looked into iDashboards and LogiAnalytics but the price tags are huge, and iDashboards have limitations on user sessions that directly obstruct how we deal with user logins (one company might have 10 people using the same User/Pass) so a "perpetual named session" is pretty unacceptable.
The ability to generate maps with the data (like a US map) and drill down to the city, county, or zip code level is also a must (though I would consider software that enables me to add this easily).
I've been searching, and searching, and have not found anything that looks useful thus far and am hoping someone out there has used something they liked and can make a recommendation.
If I can provide any more info about our requirements or needs, let me know and I'll gladly edit.
Try DBxtra, the license allow an unlimited number of report viewer users and also can do maps of pivot grids, besides it can connect to several databases and even plain text (CSV) files.
Take a look at myDBR. It will do everything you listed and much more.

Search database for offensive words [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am looking on running a search on my database at set intervals for a list of words I consider offensive (because I am an authoritarian dictator and I hate free speech - I rule with an Iron fist).
How would I most efficiently search my database for a list of keywords? The two columns I intend to search are indexed as Fulltext.
If anyone knows of a list of offensive words that would be useful too.
A note to those who ridicule my attempts at censorship
I have will have two systems in place. The first is a report function which is checked daily by admins. The second tool to combat the dissenters is this one. All it needs to be is a word search so that the admin may check through and descide if the content is offensive or not.
Mysql won't give you the tools for an acurate search, take this sample, if you have among your words:
freedom
Since you are a dictator you don't want it, it should appear, but clever users will put fr33dom, which is the same, now you have 3 ways to dot this:
You place in your list one word and
most derivations you can imagine
You make a search with a LIKE in your MySql query, but it should be sloow when you hit the thousands, even with fulltext indexes
You Index your content using Lucene
I would go for the third, since Lucene is the best choice for performing searches, and since you are looking for words I can imagine that you are dealing with text, so this might help more than you think. Lucene can help you searching words similar to freedom, but not it, there you shouldn't miss much!! And your rule is guarrantied!
There are extensions for Lucene using Zend Framework, you can find them easily in Google.
Best of luck in your dictatorial efforst!
here's your staring list!
http://onlineslangdictionary.com/lists/most-vulgar-words/
Check site for more
idea: DB their list, then screen against your DB.
Or, DB their list, create all as key words, blocking entry.
Then, use SQL wild card within words to check for: freedom or Fr**dom,
But problems tech1 derivations are infinite.
The link below leads to the list of 2200 bad words in 12 languages. MySQL dump, JSON, XML or CSV options are available.
https://github.com/turalus/openDB
Execute this dump into your own database and then query for any occurrence.

Categories