Why not create a VK post, if you set the text with spaces?

Tellingly, if the space replaced by a hyphen ('Header-image'), then the code works.
$text = 'Caption';
$m='wall.post';

$query=file_get_contents("https://api.vk.com/method/wall.post?owner_id=".$vkUserId."&access_token=".$vkToken."&message=".$text."&method=".$m."&ouath=1&v=5.70");
April 4th 20 at 13:02
1 answer
April 4th 20 at 13:04
Solution
Due to the necessity of the message encoding.
Space refers to special characters that are encoded.
Such as a space as %20.
urlencode is what You need.

Find more questions by tags PHPVKontakte