this is my curl array
CURLOPT_URL => 'https://xxxxxx.com/v2/transaction?ref_id=[ref_id]',
and i need to change [ref_id] to $result['useridInvoice'] what is the best url to solve this problem
help me please to solve my problem
this is my curl array
CURLOPT_URL => 'https://xxxxxx.com/v2/transaction?ref_id=[ref_id]',
and i need to change [ref_id] to $result['useridInvoice'] what is the best url to solve this problem
help me please to solve my problem
$result['useridInvoice'] to create the final URL.
For example, you can use the following line of code to create the final URL:
$url = 'https://xxxxxx.com/v2/transaction?ref_id=' . $result['useridInvoice'];
Then you can set the value of CURLOPT_URL to this variable:
curl_setopt($curl, CURLOPT_URL, $url);
You can also use the sprintf function to format the URL string and enter the value of$result['useridInvoice']:
$url = sprintf('https://xxxxxx.com/v2/transaction?ref_id=%s', $result['useridInvoice']);
curl_setopt($curl, CURLOPT_URL, $url);
Both of these methods will replace the [ref_id] placeholder in the URL with the value of $result['useridInvoice'], resulting in the desired final URL.