PHP curl_init负载均衡多个服务器

I've got a service that is calling a REST server. I'm using CURL to make the request. We have three endpoints to use for distributing the load. I could create some basic logic that would "randomly" pick an end point but that doesn't seem like a "good" solution. I'm wondering if there is a better solution?

define ("REST_SERVER", "http://myService.myCompany.com:8280");
...
$url = REST_SERVER.URL_SIGN;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  'Content-Type: application/json',
  'Content-Length: ' . strlen($data_string))
);
$curl_result = curl_exec($ch);

If you're looking for a poor-man's load balancer, you'd enumerate your endpoints into an array, call shuffle() and array_pop() the lucky winner.

<?php
$endpoints = array(
   'http://api1.myco.com',
   'http://api2.myco.com'
);

shuffle($endpoints);

define('REST_SERVER', array_pop($endpoints));

// ...
?>

I'd also suggest you vet each candidate to ensure it's "up"/"available" before issuing API calls, which is outside the context of this question.