Both are working, but I am asking if there is any difference or can I just use redirect(); ?
So from these 3 variants, which one is the one that I should stick to?
redirect('/');
or
redirect('');
or
redirect();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you look at the source you can see that it appends the given URL to the site_url.
So like you said, all those options work.
But I would personally recommend to use:
If you work with multiple developers this is easier to understand for those who are not familiar with CodeIgniter, since most developer know that “/” refers to the “root directory”.