<?php if (!empty($_GET['type']))
{
echo str_replace(" ", "", strtolower(htmlspecialchars($_GET['type'])));
} ?>
I want this to return ‘helloworld’ when the type variable is ‘Hello World’ and this works perfectly. However, I’m trying to add an else statement, which, for example, returns ‘invalid’ if the input is empty. How can I do this?
First of all format your code.
Second, here you go.