hallo php mir jemand was falsch mit meinem Code von true in false sagen kann, hiercurl customrequest
foreach($campinfo['pathsGroups'] as $datacamp){
echo $datacamp['active'];
$xh = curl_init();
curl_setopt($xh, CURLOPT_URL, "https://core.voluum.com/campaigns/" . $id);
curl_setopt($xh, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($xh, CURLOPT_POSTFIELDS, "$datacamp['active']= ");
curl_setopt($xh, CURLOPT_CUSTOMREQUEST, "PUT");
$head = array();
$head[] = "Cwauth-Token: " . $tok;
curl_setopt($xh, CURLOPT_HTTPHEADER, $head);
$res = curl_exec($xh);
if (curl_errno($xh)) {
echo 'Error:' . curl_error($xh);
}
iam versuchen Wert aktiv ändern die Daten zu ändern:
Array
(
[pathsGroups] => Array
(
[0] => Array
(
[condition] => Array
(
[country] => Array
(
[predicate] => MUST_BE
[countryCodes] => Array
(
[0] => IQ
)
)
[customVariableConditions] => Array
(
[0] => Array
(
[predicate] => MUST_NOT_BE
[index] => 0
[texts] => Array
(
[0] =>
[1] => Unknown
[2] => unknown
)
[text] =>
)
[1] => Array
(
[predicate] => MUST_NOT_BE
[index] => 1
[texts] => Array
(
[0] => Unknown
[1] =>
[2] => unknown
)
[text] => Unknown
)
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
)
)
[paths] => Array
(
[0] => Array
(
[weight] => 100
[active] => 1
[landers] => Array
(
[0] => Array
(
[lander] => Array
(
[id] =>
[namePostfix] =>
[name] => Global
)
[weight] => 100
)
)
[offers] => Array
(
[0] => Array
(
[offer] => Array
(
[id] =>
[name] =>
[namePostfix] =>
)
[weight] => 100
)
)
)
)
[active] => 1 //this is what iam trying to change to false or null or 0
)
)
)
Ich möchte das aktive zu false machen, um es auszuschalten, ist das möglich? Ich weiß nicht, ob dies der richtige Weg ist, um etwas zu ändern. kann jemand mir helfen, ich bin wirklich in diesem Teil stecken.
'curl_setopt ($ xh, CURLOPT_POSTFIELDS, array ($ datacamp [ 'aktiv'] => 0)); ' –
hallo danke für die Antwort Ich habe versucht, mit dem Code, den Sie zur Verfügung gestellt, und es sagt Seite funktioniert nicht. – ban