Are there holes in the code below. Is it safe to use. I will no longer use an array
$ records_msg = implode ("", $ records_msg);
php is dynamically typed. there is nothing wrong with choosing brevity due to clarity. you may want the data types of your variables to remain consistent throughout the function / method / class / subroutine. but nothing in this language prevents you otherwise.
Not really, but using a different variable name for the array can improve readability, as this is not a message yet.
, . $records_msg - , .
$records_msg
, , $records_messages, String - $records_message.
$records_messages
$records_message
Another thing. If you have an array in an array, you will lose it. Example:
<?php $input = array(1,2,3,array(4,5)); echo implode(',', $input); ?>
returns:
PHP Notice: Array to string conversion in C:\Temp\1.php on line 3 1,2,3,Array
Source: https://habr.com/ru/post/1757326/More articles:basic import questions - pythonFacebook Javascript SDK: auth.sessionChange event and auto.logout for page refresh only - javascriptwhat are these permissions used for - androidHow do I pass an expression to a method like a variable? - c #Stop IntelliJ from wrapping lines - code-formattingКак избежать добавления runat = "server", разрушающего мои теги сервера <%...%> - asp.netphpmyadmin: how to remove time limit for importing large databases - mysqlYou need the source code for the top and find the connection between top and / proc / directory in linux - linuxA way to query a database using SQLAlchemy, where is the date a specific day of the week? - pythonHow to get a snapshot of my canvas - javascriptAll Articles