Jump to content

Which method is correct way?


thilakan

Recommended Posts

$ error = trim( strip_tags($_GET['error']) );
VS
$strip_error = strip_tags($_GET['error']) ;
$trim_error = trim($strip_error);

Which method is correct way?

Also  I am first striping and trimming is it wright way.

 

could you please advice me.

 

Thank you

Edited by thilakan
Link to comment
Share on other sites

Does not matter in what order or whether you use the functions at the same time. The end result will be the same.

 

trim() removes white space characters at the start and end of a string

strip_tags() removes html tags from a string.

 

If you are having to pass messages in the url I would recommend $_SESSION instead. Anything in the URL can be changed by the user.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.