<commit_before>This is an easy to use PHP/cURL class to handle most needed tasks
#How to use examples

### To download  file
```
$curl = new Curl();
$curl->getFile('http://www.example.com');
$curl->file; // this will output the file contents

```

### post Form data
```
include 'curl.class.php';
$curl = new Curl();
$data_array['code'] = '55445';
$data_array['session'] = time();
$data_array['zipcode'] = '52415';
$data_array['Submit'] = 'Submit';
$curl->postForm('http://www.webbotsspidersscreenscrapers.com/zip_code_form.php', $data_array);
```
Every form data field have a name and value you wish to submit <br>
so the $data_array **key** is the form field name and array **value** is set to the field value <br>
for examples  <br>
$data_array['zipcode'] = '52415'; <br>
['zipcode']=> form field name '52415'=> form field value <br>


### to get only header response and the request method is HEAD
```
include 'curl.class.php';
$curl = new Curl();
$curl->getHeader('http://www.example.com/');
```
### Submits a form with the GET method
```
include 'curl.class.php';
$curl = new Curl();
$data_array['term'] = 'games';
$data_array['sort'] = 'up';
$curl->getForm('http://www.webbotsspidersscreenscrapers.com/search/search.php', $data_array);
```
### to login using basic authentication
```
include 'curl.class.php';
$curl = new Curl();
$username = 'webbot';
$password = '<PASSWORD>';
$curl->basicAuth($username, $password);
$curl->getFile('http://www.webbotsspidersscreenscrapers.com/basic_authentication');
```
### Returned Data<commit_msg>modify readme<commit_after>This is an easy to use PHP/cURL class to handle most needed tasks
#How to use examples

### To download  file
```
$curl = new Curl();
$curl->getFile('http://www.example.com');
$curl->file; // this will output the file contents

```

### post Form data
```
include 'curl.class.php';
$curl = new Curl();
$data_array['code'] = '55445';
$data_array['session'] = time();
$data_array['zipcode'] = '52415';
$data_array['Submit'] = 'Submit';
$curl->postForm('http://www.webbotsspidersscreenscrapers.com/zip_code_form.php', $data_array);
```
Every form data field have a name and value you wish to submit <br>
so the $data_array **key** is the form field name and array **value** is set to the field value <br>
for examples  <br>
$data_array['zipcode'] = '52415'; <br>
['zipcode']=> form field name '52415'=> form field value <br>
![data_array](https://raw.githubusercontent.com/abdul202/php-cURL-class/master/images/data_arrary.jpg)


### to get only header response and the request method is HEAD
```
include 'curl.class.php';
$curl = new Curl();
$curl->getHeader('http://www.example.com/');
```
### Submits a form with the GET method
```
include 'curl.class.php';
$curl = new Curl();
$data_array['term'] = 'games';
$data_array['sort'] = 'up';
$curl->getForm('http://www.webbotsspidersscreenscrapers.com/search/search.php', $data_array);
```
### to login using basic authentication
```
include 'curl.class.php';
$curl = new Curl();
$username = 'webbot';
$password = '<PASSWORD>';
$curl->basicAuth($username, $password);
$curl->getFile('http://www.webbotsspidersscreenscrapers.com/basic_authentication');
```
### Returned Data
{'fraction_non_alphanumeric': 0.18951992469406967, 'fraction_numerical': 0.01349231251961092, 'mean_word_length': 5.627858627858628, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 33, 'https://': 1, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1805319', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1074, 'n_words': 303}