Could someone please help me? via /r/learnprogramming


Could someone please help me?

I'm brand new to php and I have create a quiz that asks the user the capital of a state and then the user answers. I have this associative array created already:

 $capitals['Georgia'] = "Atlanta"; $capitals['Arizona'] = "Phoenix"; $capitals['Michigan'] = "Lansing"; $capitals['Idaho'] = "Boise"; $capitals['Nevada'] = "Carson City"; $states = array_keys($capitals); $cities = array_values($capitals); 

How to I create a question that asks the user "what is the capital of Georgia?" and then once you answer, it goes on to the next state? I've been trying to figure out for a while and I just can't. Could anyone point me in the right direction? Thank you.

Submitted July 16, 2017 at 12:21PM by angstromlevy
via reddit http://ift.tt/2tYSJoV

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s