I write PHP code to extract from Linux 'top' the server idle value and I store it in $idle. If I echo the value using php I receive this e.g.
98.5
which is correct . If I save $idle in a file in this way
file_put_contents("/usr/local/st/file, "$idle",FILE_APPEND);
and then I open the /usr/local/st/file with an editor like nano I see this
[0;10m [39;49m [1m98.5 [0;10m [39;49
as can you see it contains 98.5 but it has also a lot of undesirable chars. How to avoid it ?