1

Topic:

Day kind, is at me a variable $arResult. And if it to deduce through print_r in it there will be here such piece. At me it does not turn out to get the price in any way. Type record $arResult ["SUM"] or $arResult ["PRICE"] does not quit. I will be grateful for any help
Array ([0] => Array () [1] => Array ([ID] => 1 [PAY_SYSTEM_ID] => 1 [PERSON_TYPE_ID] => 1 [NAME] => Payment by cash or a card at obtaining [PSA_NAME] => Payment by cash or a card at obtaining [CODE] => [SORT] => 80 [ACTION_FILE] =>/bitrix/modules/sale/payment/cash [RESULT_FILE] => [DESCRIPTION] => Payment by cash at obtaining of the order to the messenger. [NEW_WINDOW] => N [PARAMS] => [TARIF] => [PS_MODE] => [HAVE_PAYMENT] => Y [HAVE_ACTION] => N [HAVE_RESULT] => N [HAVE_PREPAY] => N [HAVE_PRICE] => N [HAVE_RESULT_RECEIVE] => N [ENCODING] => [LOGOTIP] => Array ([ID] => 626 [TIMESTAMP_X] => 1/31/2017 OF 10:46:37 PM [MODULE_ID] => sale [HEIGHT] => 48 [WIDTH] => 48 [FILE_SIZE] => 17829 [CONTENT_TYPE] => image/png [SUBDIR] => sale/paysystem/logotip/05a [FILE_NAME] => 05a74e85b6e59698705f5b2f72f43eae.png [ORIGINAL_NAME] => cash.png [DESCRIPTION] => [HANDLER_ID] => [EXTERNAL_ID] => 0931ab4535b6be4f8e70acb97f95f50c [~src] => [SRC] => /upload/sale/paysystem/logotip/05a/05a74e85b6e59698705f5b2f72f43eae.png) [ACTIVE] => Y [ALLOW_EDIT_PAYMENT] => Y [IS_CASH] => N [AUTO_CHANGE_1C] => N [CAN_PRINT_CHECK] => N [BUFFERED_OUTPUT] => [IS_AFFORD_PDF] => [PATH_TO_ACTION] => /home/m/mboot/bitrix_4/public_html/bitrix/modules/sale/payment/cash/payment.php) [2] => Array () [3] => Array () [4] => Array () [5] => Array () [6] => Array () [ [9] => [10] => 0 [11] => 0 [12] => 0 [13] => 0 [14] => [15] => Array () [16] => RUB [17] => kg [18] => 1000 [19] => Array () [20] => 0 [21] => 0 [22] => 0 [23] => 0 [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => Array () [36] => Array ([new_user_registration_email_confirmation] => N [new_user_registration] => Y [new_user_email_required] => N) [37] => [38] => Array () [39] => [40] => Array () [41] => Array ([DEFAULT_COLUMNS] =>) [42] => Array ([CONFIRM_ORDER] => Y) [43] => 736 [44] => 736 [45] => Array ([736] => Array ([ID] => 736 [ORDER_ID] => 736 [ACCOUNT_NUMBER] => 736/1 [PAID] => N [DATE_PAID] => [EMP_PAID_ID] => [PAY_SYSTEM_ID] = PS_CURRENCY] => [PS_RESPONSE_DATE] => [PAY_VOUCHER_NUM] => [PAY_VOUCHER_DATE] => [DATE_PAY_BEFORE] => [DATE_BILL] => Bitrix\Main\Type\DateTime Object ([value:protected] => DateTime Object ([date] => 2018-04-04 16:23:12.000000 [timezone_type] => 3 [timezone] => Europe/Moscow)) [XML_ID] => [SUM] => 5900.0000 [PRICE_COD] => 0.0000 [CURRENCY] => RUB [PAY_SYSTEM_NAME] => Payment by cash or a card at obtaining [RESPONSIBLE_ID] => [EMP_RESPONSIBLE_ID] => [DATE_RESPONSIBLE_ID] => [COMMENTS] => [COMPANY_ID] => 0 [PAY_RETURN_NUM] => [PAY_RETURN_DATE] => [EMP_RETURN_ID] => [PAY_RETURN_COMMENT] => [IS_RETURN] => N [MARKED] => N [DATE_MARKED] => [EMP_MARKED_ID] => [REASON_MARKED] => [UPDATED_1C] => N [ID_1C] => [VERSION_1C] => [EXTERNAL_PAYMENT] => N)) [46] => Array ([1] => Array ([ID] => 1 [PAY_SYSTEM_ID] => 1 [PERSON_TYPE_ID] => 1 [NAME] => Payment by cash or Card at obtaining [PSA_NAME] => Payment by cash or a card at obtaining [CODE] => [SORT] => 80 [ACTION_FILE] =>/bitrix/modules/sale/payment/cash [RESULT_FILE] => [DESCRIPTION] => Payment by cash at obtaining of the order to the messenger. [NEW_WINDOW] => N [PARAMS] => [TARIF] => [PS_MODE] => [HAVE_PAYMENT] => Y [HAVE_ACTION] => N [HAVE_RESULT] => N [HAVE_PREPAY] => N [HAVE_PRICE] => N [HAVE_RESULT_RECEIVE] => N [ENCODING] => [LOGOTIP] => Array ([ID] => 626 [TIMESTAMP_X] => 1/31/2017 OF 10:46:37 PM [MODULE_ID] => sale [HEIGHT] => 48 [WIDTH] => 48 [FILE_SIZE] => 17829 [CONTENT_TYPE] => image/png [SUBDIR] => sale/paysystem/logotip/05a [FILE_NAME] => 05a74e85b6e59698705f5b2f72f43eae.png [ORIGINAL_NAME] => cash.png [DESCRIPTION] => [HANDLER_ID] => [EXTERNAL_ID] => 0931ab4535b6be4f8e70acb97f95f50c [~src] => [SRC] => /upload/sale/paysystem/logotip/05a/05a74e85b6e59698705f5b2f72f43eae.png) [ACTIVE] => Y [ALLOW_EDIT_PAYMENT] => Y [IS_CASH] => N [AUTO_CHANGE_1C] => N [CAN_PRINT_CHECK] => N [BUFFERED_OUTPUT] => [IS_AFFORD_PDF] => [PATH_TO_ACTION] => /home/m/mboot/bitrix_4/public_html/bitrix/modules/sale/payment/cash/payment.php)) [47] => Array ([ID] => 736 [LID] => s1 [ACCOUNT_NUMBER] => 736 [TRACKING_NUMBER] => [PAY_SYSTEM_ID] => 1 [DELIVERY_ID ] => 10 [DATE_INSERT] => Bitrix\Main\Type\DateTime Object ([value:protected] => DateTime Object ([date] => 2018-04-04 16:23:12.000000 [timezone_type] => 3 [timezone] => Europe/Moscow)) [DATE_UPDATE] => Bitrix\Main\Type\DateTime Object ([value:protected] => DateTime Object ([date] => 2018-04-04 16:23:12.000000 [timezone_type] => 3 [timezone] => Europe/Moscow)) [PERSON_TYPE_ID] => 1 [USER_ID] => 1 [PAYED] => N [DATE_PAYED] => [EMP_PAYED_ID] => [DEDUCTED] => N [DATE_DEDUCTED] => [EMP_DEDUCTED_ID] => [REASON_UNDO_DEDUCTED] => [STATUS_ID] => N [DATE_STATUS] => Bitrix\Main\Type\DateTime Object ([value:protected] => DateTime Object ([date] => 2018-04-04 16:23:12.000000 [timezone_type] => 3 [timezone] => Europe/Moscow)) [EMP_STATUS_ID] => 1 [MARKED] => N [DATE_MARKED] => [EMP_MARKED_ID] => [REASON_MARKED] => [PRICE_DELIVERY] => 0.0000 [ALLOW_DELIVERY] => N [DATE_ALLOW_DELIVERY] = > [EMP_ALLOW_DELIVERY_ID] => [RESERVED] => N [PRICE] => 5900.0000 [CURRENCY] => RUB [DISCOUNT_VALUE] => 0.0000 [TAX_VALUE] => 0.00 [SUM_PAID] => 0.00 [USER_DESCRIPTION] => [PAY_VOUCHER_NUM] => [PAY_VOUCHER_DATE] => [ADDITIONAL_INFO] => [COMMENTS] => [COMPANY_ID] => 0 [CREATED_BY] => 1 [RESPONSIBLE_ID] => [STAT_GID] => [DATE_PAY_BEFORE] => [DATE_BILL] => [IS_RECURRING] => N [RECURRING_ID] => [LOCKED_BY] => [DATE_LOCK] => [RECOUNT_FLAG] => Y [AFFILIATE_ID] => [DELIVERY_DOC_NUM] => [DELIVERY_DOC_DATE] => [UPDATED_1C] => N [ORDER_TOPIC] => [XML_ID] => [ID_1C] => [VERSION_1C] => [VERSION] => 0 [EXTERNAL_ORDER] => N [STORE_ID] => [CANCELED] => N [EMP_CANCELED_ID] => [DATE_CANCELED] => [REASON_CANCELED] => [BX_USER_ID] => 544371a2469e61b53b66e7d396849462 [RUNNING] => N [IS_ALLOW_PAY] => Y [PAYMENT_ID] => 736))

2

Re:

Such [CODE] => [SORT] => 80 [ACTION_FILE] =>... In an array cannot be, and to deduce an array it is necessary in tag PRE, and such result to show, if want to receive the answer.

3

Re:

print_r it is not so convenient, use function var_dump is better
And is even better make here so:

echo ' <pre> ';
var_dump ($arResult);
exit;//that superfluous was not, only here I do not remember intercepts it  or not

And generally what that PRICE in an array explicitly is

[PRICE] => 5900.0000

4

Re:

krundetz, 4/4/2018, 18:35, post2675672 wrote:

print_r it is not so convenient

Than? If it is necessary to contemplate types, var_dump and if it is necessary to look at an array structure, var_dump just the superfluous.

5

Re:

That is simple reversal of type $arResult ["PRICE"] is not present?

6

Re:

cppGhost, 4/4/2018, 20:18, post2675674 wrote:

that is simple reversal of type $arResult ["PRICE"] is not present?

If it is array primary key it is possible, but if it in the twentieth knee an enclosure all over is not present. You do not write letters "on village to the grandfather", does not reach, it will be necessary to fill out a village name, where this village, and a surname of the grandfather.

7

Re:

And if as that recursively to be transversed on all elements and to find this key SUM?

8

Re:

It is possible and to bypass recursively if not to know layout, if it is known simply at once to address.

9

Re:

[QUOTE=whatisnot, 4/4/2018, 18:38, post2675673] Than? If it is necessary to contemplate types, var_dump and if it is necessary to look at an array structure, var_dump just the superfluous. [/QUOTE]
That that if it contains blank lines, values null and false array structure to look not conveniently, especially if it deduced as a normal line
[QUOTE=whatisnot, 4/4/2018, 16:44, post2675671] Such [code] => [SORT] => 80 [ACTION_FILE] =>... In an array cannot be [/QUOTE]
Your statement, and here only empty values and an output in single line. And on yours any more an array.:dirol
The code:
[code]
<pre>
<? php
$str = array (' 1 ' => ", ' 2 ' => null, ' 3 ' => false, ' 4 ' => 4);
print_r ($str);
var_dump ($str);
[/code]
Output:
[code]
Array
(
[1] =>
[2] =>
[3] =>
[4] => 4
)
array (4) {
[1] =>
string (0) ""
[2] =>
NULL
[3] =>
bool (false)
[4] =>
int (4)
}
[/code]
[QUOTE=cppGhost, 4/4/2018, 20:18, post2675674] that is simple reversal of type $arResult ["PRICE"] is not present? [/QUOTE]
Here I asked you, and whatisnot to draw the formatted output, work a little then receive the answer to the question

10

Re:

krundetz, 4/5/2018, 15:42, post2675698 wrote:

that that if it contains blank lines, values null and false array structure to look not conveniently, especially if it deduced as a normal line

krundetz, 4/5/2018, 15:42, post2675698 wrote:

your statement, and here only empty values and an output in single line. And on yours any more an array.

You are assured what speak? It is not necessary to confuse flies to cutlets.
In what the contradiction of an output of an array $str = array (' 1 ' => ", ' 2 ' => null, ' 3 ' => false, ' 4 ' => 4); by means of print_r?  to me var_dum if I need to learn an array structure? It is empty or NULL it in any way do not break, and not they lead to errors [key] => [key] =>...
Do not bullshit a mine.

11

Re:

[QUOTE=whatisnot, 4/5/2018, 16:29, post2675699] do not bullshit a mine. [/QUOTE]
You overestimate the importance for me
[QUOTE=whatisnot, 4/5/2018, 16:29, post2675699] Nahrena to me var_dum if I need to learn an array structure? It is empty or NULL it in any way do not break, and not they lead to errors [key] => [key] =>... [/QUOTE]
1. To swear not well
2. To use not to write here it:
[QUOTE=whatisnot, 4/4/2018, 16:44, post2675671] Such [CODE] => [SORT] => 80 [ACTION_FILE] =>... In an array cannot be [/QUOTE]
Again I will repeat that it is your words, not mine. I will repeat once again errors there is not present and at usage print_r an output such perhaps. Look the code resulted by me.
cppGhost
Try addresses to $arResult [47] ["PRICE"] and $arResult [45 [736] ["SUM"], but I think to you does not prevent to understand that why they at you are stored under such indexes

12

Re:

krundetz , you can explain how ignorance or misunderstanding of operation of function what the key => leads such visual errors as a key =>, can do automatically function inconvenient? var_dump out of a tag pre too a line and it is better nothing print_r for an array as string representation in any of these functions does not give understanding about its structure that is where there is a key necessary to us. Namely it also is necessary for the author the nobility to understand what to undertake. Well be an array in three elements all right, but such ... Than var_dump it is better, what helps?
Well for categorical announcements. It is equivalent as to tell XML the full sediment, it is not visible types, despite that is XCD.

13

Re:

[QUOTE=whatisnot, 4/6/2018, 13:20, post2675718] Well for categorical announcements. It is equivalent as to tell XML the full sediment, it is not visible types, despite that is XCD. [/QUOTE]
;
[QUOTE=krundetz, 4/4/2018, 18:35, post2675672] print_r it is not so convenient, use function var_dump [/QUOTE] is better
It you name categorical?
[QUOTE=whatisnot, 4/6/2018, 13:20, post2675718] you can explain how ignorance or misunderstanding of operation of function what the key => leads such visual errors as a key =>, can do automatically function inconvenient? [/QUOTE]
Ignorance the HARDWARE a subject does function print_r by the extremely inconvenient. It does not understand yet a subject and continues fingers to pinch to itself this function.
And it entered you into error.
[QUOTE=whatisnot, 4/4/2018, 16:44, post2675671] Such [CODE] => [SORT] => 80 [ACTION_FILE] =>... In an array cannot be [/QUOTE]
Your words?
On announcement of developers
[QUOTE]
print_r - Deduces the legible information on a variable
[/QUOTE]
Here explain to me as blank line (instead of false or null) will be legible? Especially to beginners who with own arrays cannot understand?
Therefore I also recommend to use var_dump .

14

Re:

krundetz , all that you write philosophy for no reason, the author should read a manual, for what function not to deduce  its array out of a tag pre, she prompts nothing to it. For understanding where to search necessary, it is necessary to see array structures, and it is necessary to know it as to deduce correctly, all your remaining arguments from the crafty.

15

Re:

whatisnot, 4/6/2018, 18:43, post2675725 wrote:

krundetz, all that you write philosophy for no reason

At me just reverse impression.
I to you argued both the code and citations from a manual. From you I saw only a consciousness flow. You did not answer one my question though them was a little.
The last question such what for function print_r if too most and even more I receive all is necessary to me using var_dump or var_export ?

16

Re:

krundetz, 4/9/2018, 10:47, post2675772 wrote:

the Last question such what for function print_r if too most and even more I receive all is necessary to me using var_dump or var_export?

You yourselves ask it, than more conveniently var_dump if it is necessary to know only structure? Anything. The trouble of the author not that they used print_r, and that he does not know as it correctly to use. All remaining, it simply demagogy.

17

Re:

whatisnot, 4/9/2018, 15:30, post2675777 wrote:

you yourselves ask It

I asked you. But time you insist I will repeat the arguments for usage var_dump instead of print_r
1. The output print_r is not always obvious.
2. There are analogs with more obvious output.
3. It is easier to beginner to learn to use 1st function than 2-mja, especially when he plainly does not understand many singularities of language.
4. Beginners use print_r according to a manual for an output of the legible information on a variable, and not just for array structure review. Only here there is point 1.

whatisnot, 4/9/2018, 15:30, post2675777 wrote:

All remaining, it simply demagogy.

You already in what only did not accuse me, and of philosophy for no reason, and in that that I bullshit you, and in that that I confuse flies to cutlets, and in that that arguments at me from crafty, now here in demagogues wrote down. Can better arguments for print_r result will, or counterarguments for var_dump?

18

Re:

Again demagogy on the whole volume. You than hammer in nails, I hope a hammer, instead of a pneumohammer? A companion should know as correctly an array structure to display, and it is all. I at all against function var_dump, and simply do not understand when make statements which as a matter of fact to a problem of the relation have no.

19

Re:

whatisnot, 4/9/2018, 17:51, post2675781 wrote:

Again demagogy on the whole volume. You than hammer in nails, I hope a hammer, instead of a pneumohammer? A companion should know as correctly an array structure to display, and it is all. I at all against function var_dump, and simply do not understand when make statements which as a matter of fact to a problem of the relation have no.

1. I prompted the HARDWARE a variant which I consider optimal for the decision of its problems
2. I on yours will note to the request some times justified the point of view
3. It probably does not suit you, but you do not result arguments
4. But write a heap of charges to my address precisely not as a matter of fact problems
5. If you that that do not understand that THESE ARE YOUR PROBLEMS
The attentive reader makes outputs. On it our discussion I consider closed.

20

Re:

Would be what to read smile I after all not therefore wrote to prick, that is why that the remark about  was out of place. It how to argue on life on Mars when it it is not required.
Also it agree, it is an insignificant talk - PRE-> function, all that was necessary, and what of them not an essence important.

21

Re:

In plus to the previous orator - var_dump for example  , and print_r at first in storage collects.
Than it threatens?
If to the browser "" object with UNOBVIOUS recursive links - write disappeared, consider a computer it is necessary to reboot. print_r it is simple  on shortage of storage (if certainly memory_limit it is exposed)
Well for check can  what  Entity :crazy
It is all provided that on a local computer development goes (php-S). For a server I am afraid to answer under such circumstances)

22

Re:

[QUOTE = _ zorn _, 4/10/2018, 15:35, post2675809] In plus to the previous orator - var_dump for example  , and print_r at first in storage collects. [/QUOTE]
1. The interesting information, here for the sake of it also was conducted all polemic with whatisnot .
2. Such behavior did not face, it is possible because of xdebug, it like regulates behavior var_dump
3. It is possible  on the detailed description, and that that google produces nothing that

23

Re:

krundetz, 4/11/2018, 11:22, post2675831 wrote:

here for the sake of it all polemic with whatisnot

also was conducted
Polemic not clear. It is possible to speak long about advantages or lacks something, this one and takes place to be in frames just abstract polemic. To subject to criticism one, speaking about advantages of another in a context when any of it is not applied to destination (properly), it any more polemic, and chatter. smile
Both these functions assume the formatted output, therefore in them the line feed code and gaps for indents contains, thus var_dump uses two gaps on one level, and print_r four. If data output of functions was produced in the Notepad then and talks were not. But in this case all in a context the web, a notepad is the browser, and it not the text, and html, and line feed in it is treated as a gap. It needs to be known and understood, then to an output we know that we receive not what it would be desirable, and not important what function we will use.
The task is "address" calculation, and in a flow of a line to calculate it difficult though and it is possible. On what base thus it is possible to state, what one is better or worse than another? Here after all the error not in application of the "necessary" function, and where lives in representation of result of operation of function which does not give the answer to a question - "the addressee?". It after all is absurd as though for mixing, also, what house or quarter and consequently without finding in it the necessary house, to state that if mixed counter-clockwise it would be better. smile
If to speak  even in this case it is incorrect to state that one function is better another, is simple each of them fulfills that and is offered to it. Print_r it is more convenient for structure representation at least already because four gaps on an indent, and it is tabulation by default, and style of arrangement of curly brackets. Var_dump besides deduces types with transfer for a new line that complicates array structure perception a little.
Owing to that print_r uses storage its output it is possible to intercept in a variable that it is possible to use for simple debugging in ajax-inquiries. Thus if for review it is used alert it is simple enough echo print_r (array, 1), but also not the problem to add at line and a tag pre.
But if it is necessary to view types in an array only the fool can state that print_r it is for this purpose more convenient, for it simply does not do it.
And it about other function though if to dissolve polemic unnecessary also it is possible to speak long, proving that one is better/is worse another. This not rarely observable phenomenon - $row =... fetch_array ($result) without those instructions that is necessary though the associative dial-up is used only. It thus that is and fetch_assoc (). And such banal habit leads to banal errors, over which heroically struggle on the client instead of using competently fetch_array () or instead of it fetch_assoc ().
Whether but it is possible to state in this case, what fetch_array () inconvenient function? It is possible to state certainly but only if for the sake of to make laugh a hedgehog.  it is necessary to study, here in what an essence, and to polemize in such cases harmfully for it can state in consciousness beginning incorrect representation or even fatal belief. In it there was an essence of my question - than one, it is better than another.

24

Re:

whatisnot, 4/12/2018, 10:25, post2675859 wrote:

Owing to that print_r uses storage its output it is possible to intercept in a variable

I so understood speech about the second parameter installed in true?

whatisnot, 4/12/2018, 10:25, post2675859 wrote:

that it is possible to use for simple debugging in ajax-inquiries.

Here it did not understand, the answer and and so a line, in what a dirty trick?

25

Re:

krundetz, 4/12/2018, 15:20, post2675871 wrote:

I so understood speech about the second parameter installed in true?

Yes, but it if for the sake of polemic, telling about any advantages/possibilities of function, and in a context of its not appropriate usage, it has no anybody value.

krundetz, 4/12/2018, 15:20, post2675871 wrote:

here it did not understand, the answer and and so a line, in what a dirty trick?

Here there is no dirty trick - alert deduces the text as is, that is if in the text there is a line feed there will be an output in a new line, and all gaps are considered, therefore simply enough to deduce result of function. But if, for example, in the client script the server answer to deduce on page will be too most, as at the author of a post, therefore and it is required to frame with tag PRE and not to do components for the sake of it in the client script, same small debugging it is more favourable to make it on the server.
PS. By the way, can such miracle when produce an output in the browser so caught sight?

echo "<option>.... </option> \r\n";

Probably too hope that see beauty in it. And with such examples manual  on an official site and though for decency tag PRE would be mentioned, on the contrary, here abounds also and feet of problems of everyones grow, and to read laziness.)