Jump to content

Optional Arguments


Arkane

Recommended Posts

Hey folks

I'm trying to teach myself some PHP, and I've managed to make a working script with arguments in the url.

 

So far I have file.php?name=Leroux

 

I'm looking to change it to have a secondary argument which is optional.

 

eg file.php?name=Leroux&lives=UK

 

I know how to do it as a required, but my method tends to break it if the parameter isnt there.

Any suggestions?

Cheers guys

Link to comment
https://forums.phpfreaks.com/topic/131638-optional-arguments/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.