diff --git a/services.module b/services.module
index 6486e65..b7c3035 100644
--- a/services.module
+++ b/services.module
@@ -10,6 +10,40 @@
  */
 define('SERVICES_REQUIRED_CTOOLS_API', '1.7');
 
+if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+  if (!function_exists('str_getcsv')) {
+    /**
+     * Parse a CSV string into an array
+     * @link http://www.php.net/manual/en/function.str-getcsv.php
+     * @param input string <p>
+     * The string to parse.
+     *
+     * @param delimiter string[optional] <p>
+     * Set the field delimiter (one character only).
+     *
+     * @param enclosure string[optional] <p>
+     * Set the field enclosure character (one character only).
+     *
+     * @param escape string[optional] <p>
+     * Set the escape character (one character only). Defaults as a backslash
+     * (\)
+     *
+     * @return array an indexed array containing the fields read.
+     */
+    function str_getcsv($input, $delimiter=',', $enclosure='"', $escape = '\\') {
+      $temp = fopen("php://memory", "rw");
+      fwrite($temp, $input);
+      fseek($temp, 0);
+      $r = array();
+      while (($data = fgetcsv($temp, 4096, $delimiter, $enclosure, $escape)) !== false) {
+        $r[] = $data;
+      }
+      fclose($temp);
+      return $r;
+    }
+  }
+}
+
 /**
  * Implementation of hook_help().
  */
@@ -423,7 +457,7 @@ function services_resources_as_procedures($resource) {
  *
  * @param $resource
  *   The resource being converted (node, user, etc.)
- * @param $name 
+ * @param $name
  *   The method name (retrieve, create, etc.)
  * @param $controller
  *   Associative array defining the method's properties and callbacks.
@@ -475,12 +509,12 @@ function services_resource_build_index_query($schema, $order, $page, $fields, $s
   if (is_array($service_params)) {
     foreach ($service_params as $param_field => $param_value) {
       $in_placeholders = array();
-      foreach (explode(',', $param_value) as $single_value) {
+      foreach (str_getcsv($param_value) as $single_value) {
         $in_placeholders[] = db_type_placeholder($schema['fields'][$param_field]['type']);
         $query_params[] = $single_value;
       }
       $where[] = $primary_table . '.' . $param_field . ' IN (' . implode(',', $in_placeholders) . ')';
-    } 
+    }
   }
 
   // Now implode that array into an actual WHERE clause.
