How can I do the below using Joomla API
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.Sign up to join this community
TL;DR: there is no equivalent, because it's not needed.
JInput data is by default a reference to
$_REQUEST, so it dosen't have own unset method, because it is not needed. Although it would be nice to have
$input->unset('variable1'); for completness of API.
You should use plain PHP, e.g
unset($_REQUEST['variable1']);. If you have your variable in
$_GET, you can unset by that, if you prefer.
Although you can always use
$input->set('variable1', null);, but this way PHP carbage collector won't free memory, since variable is still defined.