PHP curl获取多维数组

时间:2017-04-04 14:40:28

标签: php curl get

我正在尝试使用gitlab API获取问题列表。响应是正确的测试URL,但curl不会在我的PHP代码中执行。我猜它是因为多维数组。但是你怎么解决这个问题?这是我的功能:

function getissues_list () {

    $url = MAIN_URL."/issues";

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPGET , true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $this->token);
    $response = curl_exec($ch);

    if (!curl_exec($ch)) {

        echo ($this->exception_message);

    } else{
        return $response;
        curl_close($ch);
    }

}

谢谢!

1 个答案:

答案 0 :(得分:0)

- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
{
    CGFloat centerX = self.collectionView.contentOffset.x + self.collectionView.frame.size.width * 0.5;

    NSArray *attributes = [super layoutAttributesForElementsInRect:rect];

    for (UICollectionViewLayoutAttributes *attrs in attributes) {

        CGFloat diff = ABS(attrs.center.x - centerX);

        CGFloat newScale = diff * scaleFactor / (self.itemSize.width + self.minimumLineSpacing);

        if (newScale > scaleFactor) {
            newScale = scaleFactor;
        }

        attrs.transform = CGAffineTransformMakeScale(1 - newScale, 1 - newScale);
    }

    return attributes;
}