The CodeIgniter Input Class Provides some helper functions to deal with user inputs , this class is initialized automatically by the system so there is no need to do it manually.
I always recommend you to use this class instead using PHP Core Input Variables while dealing with forms and requests.
To check Ajax Request in CodeIgniter, we will use codeIgniter Output Class Method class is_ajax_request() , this function checks to see if the HTTP_X_REQUESTED_WITH server header has been set, if set response will be true otherwise false means it will returns a boolean response.
here is the Code:
you can use something like this.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.