I need to get some javascript variable names from user. And user can enter only valid variable names. For instance:
"test1" - valid input,
"test 1" - not valid input.
"_a" - valid.
Now I am looking for php code which can validate user input with javascript variable naming standards.