R
R
rusgayfer2017-09-01 19:17:54
In contact with
rusgayfer, 2017-09-01 19:17:54

Problem with array array method wall.post how to fix?

I get id groups from the base, separated by commas, I insert them into an array, but it does not work, how can I fix it?
I get from the base, for example, this is the value 68946366,25089415
I output an array

$group_pars = array($group_parser); // где $group_parser эти самые значения

But this way it gives an error
[ 01.09.17 19:12:06] Смотрим группу "68946366,25089415": ответ error: (100)One of the parameters specified was missing or invalid: owner_id not integer

And if you do this by adding numbers to the code itself right away, then everything works. Then there is such a cycle
$group_pars = array(68946366,25089415);
foreach($group_pars as $key => $group) {

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serezha, 2017-09-01
@rusgayfer

The wall.post method accepts ONE id. You, for some reason, shove two there separated by a comma.
Do you have it written in the database in one line, "68946366,25089415"? What nonsense.
And if such stupidity is already achieved, then you need to split this line into an array, for example, explode:

$ids = "12312312,12312312,12312312";
$ids = explode(",", $ids);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question