P
P
PO6OT2015-12-10 22:34:20
PHP
PO6OT, 2015-12-10 22:34:20

Is there a complete analogue of cURL in PHP as a library?

Is there a cURL library in PHP with exactly the same interface as the original one to run scripts that require cURL without editing?
Do not offer extensions, I do not have the ability to install them.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
E
evnuh, 2015-12-10
@evnuh

No.
And buy yourself a VDS already and don't torture us with your "don't offer extensions". And what is the library in your question?

D
Deerenaros, 2014-04-09
@Nedbow

If you want your bike instead of using Array.every (thanks @k12th ), then something like this:

var num = 5,
    all = true,
    arr = [1, 5, 7, 9];

for(var i = 0; i < a.length && all; i++) {
    if( all )
        all = arr[i] == num;
}

Maybe even more perverted:
for(var i = 0; i < a.length && (all = arr[i] == num); i++);

K
Konstantin Kitmanov, 2014-04-09
@k12th

arr.every(function (elem) { return elem === num })
Array.every

T
Tyranron, 2014-04-09
@Tyranron

It is probably more reasonable, simpler and more productive to go from the opposite.

var num = 5,
    all = true,
    arr = [1, 5, 7, 9];

for(var i = 0; i < a.length; i++) {
    if(arr[i] != num) {
        all = false;
        break;
    }
}

A
AVI, 2014-04-09
@AVI

var num = 5,
    arr = [1, 5, 7, 9],
    all = arr.length?true:false;

for(var i = 0; i < arr.length; i++) 
    if(arr[i] != num) {
        all = false;
        break;
    }

A
AVI, 2014-04-09
@AVI

var num = 5,
    arr = [1, 5, 7, 9];
   
all=arr.filter(function(item){ return item !=num; }).length?false:true;

S
Sergey Melnikov, 2014-04-09
@mlnkv

there is a useful method for js arrays - every(), the function of checking each value of the array is passed to it and returns true if all elements passed the test

var array = [1, 5, 7, 9],
  num = 5, all;
all = array.every(function(val){ return val == num });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question