Skip to content
Advertisement

how to parse   into txt file with file_put_contents

I am trying to parse a space form an input field in a txt file with file_put_contents but i do not succeed in it with htmlentities.

JavaScript

per example if i first type a space in the input and after the text test my txt file looks like this:

JavaScript

and it should be

JavaScript

How can i achieve this?

Advertisement

Answer

If it is only about spaces, you could just replace it with str_replace

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement