E
E
Eugene2017-08-28 17:07:47
PHP
Eugene, 2017-08-28 17:07:47

Why vk API execute swears at "\r\n" and "\n"?

implode("\n", $str_array)
$result = 'return API.messages.send({"user_id": "' . $what . '", "message":  "' . $str_array . '"});';

$data = $vk->api("execute", array('code' => $code));

When you try to execute the query, it complains about merging the array by "\n", if you merge it by "+" or otherwise (without a line break), then everything is fine. Tell me how to make a line break?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2017-08-28
@Flashter

In general, the solution is a crutch: the merge should be done like this:
implode("<br>", $str_array)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question