Is it possible to list variables in a Java-like style in PHP, for example, removing the need for a character $every time? If so, how can I enable a setting that does this?
$
No.
Sorry, this is not possible. The closest you will get the constants:
define('CONS', 5); echo CONS;
, .
PHP, . , PHP $ , :
$bob = "rabbit" $joe = "dragon-$bob" // ==> dragon-rabbit
. Ruby, - , :
bob = "rabbit" joe = "dragon-#{bob}"
Java (, Java, StringBuffer " + bob + "... , ).
" + bob + "
, ( ).
, PHP- ( , ), , ... !
. PHP $.
- .
Java :
str = "some string"; System.out.print(str.contains("some"));
.
Source: https://habr.com/ru/post/1705996/More articles:Интеграция Jabber в ASP.NET - asp.netUnable to use SED for quick file editing - sedSQL group by date - sqlEnv Variables in Python (v3.0) on Windows - pythonbeginner C ++: virtual functions in a base class - c ++как получить доступ к поля перечисления mySQL с помощью Java ResultSet и PreparedStatement - javaIs there a security risk not to use the .htaccess file? - securityИспользование асфальтоукладчика и носа вместе с нетипичной структурой каталогов - pythonTables ACCPAC - databaseFree Nhibernate (ClassMap) issue - c #All Articles