How to use Php code in Views page contextual filter with dynamic URL i.e using %? I have a content type App with a term reference field called App category.

I'm creating a view page with path app/%. I don't want to use App ID or anything numeric in URL in place of %, so I'll be using app/cooking-app where cooking-app is URL Alias of App Category. 

How can I display all the nodes whose value in App Category field is cooking-app? I can easily do this using PHP code but PHP code in contextual filters is not working.
I'd highly recommend not using PHP code to do this; tying PHP code to configuration can be error-prone and it won't exist in Drupal 8's Views. 

Rather, you can use the solution in Drupal 7 views contextual filters taxonomy name where you can use the Validator, Taxonomy Term, instead of PHP Code, with the Term name converted to Term ID filter.