3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasGroupUrlInAppwrite($groupUrl) { $baseUrl = "https://nyc.cloud.appwrite.io/v1"; $projectId = "solion"; $projectJWT = "standard_2a24b2a81778aad83acec7a7bd8d6223c42d4cb21410f7dc93d1481dae2fab2cb0f75e88cde4b2f4bdb81ad92e9e29b24100944f32f5093b52e99e178d68875e2835a0357ac1f08996889d7ad5dad3037c6ad2bba3419e80c01a5bcc5e88beab0682039ae6d197a2d0c000ca7e59e02a8def68fb17191d78ea27feaf804cc9ce"; $databaseId = "solion-app"; $collectionId = "groups"; $url = $baseUrl . "/databases/" . $databaseId . "/collections/" . $collectionId . "/documents"; $params = array( 'queries[]' => json_encode(array( 'method' => 'equal', 'column' => 'url', 'values' => [$groupUrl], )), 'total' => true, ); $url .= '?' . http_build_query($params); $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'X-Appwrite-Project: ' . $projectId, 'X-Appwrite-Key: ' . $projectJWT, ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); if (curl_errno($ch)) { return false; } curl_close($ch); error_log($response); $data = json_decode($response, true); if (isset($data['total']) && $data['total'] > 0) { return true; } else { return false; } }
Output for git.master, git.master_jit

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.66 ms | 405 KiB | 5 Q