Question: How to get a part of string using PHP?

I have a string like this.

```
$str = 'href="http://www.idontknow.com/areyousure?answer=yes"';

```

I want only the link.. like this

```
$str_new = "http://www.idontknow.com/areyousure?answer=yes";

```

Answer: 
```
$str = 'href="http://www.idontknow.com/areyousure?answer=yes"';
preg_match('/href="(.*)"/', $str, $matches);
$str_new = $matches[1];

echo $str_new;

```

Output:

```
http://www.idontknow.com/areyousure?answer=yes

```
Try

```
$result = substr($input, 6, strlen($input) - 1);

```