I'm trying to neaten my code by using functions in PHP. I know my function works for sure but when I created a class in PHP to store my function an error appears 

> 
> Parse error: syntax error, unexpected 'getsquad' (T\_STRING), expecting
>  function (T\_FUNCTION) in C:\wamp\www\tutorials\squad.php on line 18.
> 
> 
> 

line 18 is where I'm calling my function. for testing proposes.

```
<?php
include 'simple_html_dom.php';

class squad{

    function getsquad($url){
        $html = file_get_html($url);
        foreach ($html->find('td[align=left]') as $element) {
           if ($element->children(0)) { // work only when children exists
               return $element->children(0)->innertext.'<br>';
           }
        }
    }

    getsquad('$site');

} 

?>

```

It should be something simple it just that I'm quite new to PHP.