Jump to content

Variables for every character?


AbydosGater

Recommended Posts

Hi im working on a game project and i need to have an array or variable for every character, number and symbol that a computer can make.. its kind of like if you wanted to make an encryptor you would asign each variable its encrypted value and make a program to switch them.. like:

 

$abw["a"] = "letter1";

$abw["b"] = "letter2";

$abw["c"] = "letter3";

$abw["A"] = "letter27";

$abw["B"] = "letter28";

 

But when you get to the symbols like \ or " they become a problem..As you can see

$abw["""] or $abw["\"] would never work and cause lots of errors!?!

 

Is there a better way to do this?

Link to comment
https://forums.phpfreaks.com/topic/40255-variables-for-every-character/
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.