I
I
IgorPlays2021-06-15 19:26:09
PHP
IgorPlays, 2021-06-15 19:26:09

How to pass data to a variable?

I have such a dataset from a webhook, I displayed them using print_r($resultDeal);

Array
(
[result] => Array
(
)

[total] => 0
[time] => Array
(
[start] => 1623774168.0414
[finish] => 1623774168.1211
[duration] => 0.079643964767456
[processing] => 0.023499011993408
[date_] => 2021-06-15T19:22:48+03:00
[date_finish] => 2021-06-15T19:22:48+03:00
)

)

I need to take data from the [date_start] string => 2021-06- 15T19:22:48+03:00
and assign to variable how to do it?*

here is the webhook code from which I take data

<?php

define('C_REST_WEB_HOOK_URL','https://b24-fq8kms.bitrix24.kz/rest/1/jxva914c322019hn/');

require_once('crest.php');


$resultDeal = CRest::call(
        'crm.lead.list',                       
        [
            'id' => $_REQUEST["data"]["FIELDS"]["ID"]
    ]);

echo '<PRE>';
print_r($resultDeal);
echo '</PRE>';

?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Gus, 2021-06-15
@IgorPlays

$newVar = $resultDeal->time['date_start']
If $resultDeal is also an associative array then
$newVar = $resultDeal['time']['date_start']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question