A
A
AlexMark2017-03-14 12:49:16
PHP
AlexMark, 2017-03-14 12:49:16

How to open files in phpstorm with correct encoding?

If I connect via ftp/sftp to the server via Notepad++, the files are opened in the encoding they are on the server and I can work with them, save them without fear that I will break the encoding. In phpstorm, when I open it, very often there are question marks, I need to constantly reopen it in a new encoding, go to the site, look in which one. How to open files right away in the encoding in which they are on the server?
The option with crtl-alt-s ->File Encodings is also bad, because again I have to set a static encoding there, and files can be of different encodings.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-12-25
@FitTech

Good evening.
Customize this check for yourself.

['date_to', 'date', 'when' => function($model){
                 return strtotime($model->date_to) < strtotime($model->date_from);
}]

You are trying to compare a string. You need to convert these strings to dates. This is done using strtotime();, although there are other options to convert a string to a date.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question