【发布时间】:2023-03-20 14:45:01
【问题描述】:
我正在使用sprintf() PHP 函数并尝试将这个 url 格式化为:
"/api/v1/post/1/225883"
我有:
const API_URL = '/api/v1';
const POST_ENDPOINT = '/post';
$this->client->getId()
$this->post->getDestinationId()
我试过了:
sprintf(self::API_URL . self::POST_ENDPOINT,
$this->client->getId(),
$this->post->getDestinationId());
我得到:/api/v1/post
有人可以帮忙吗?
【问题讨论】: