# Solved: PHP Include for a string?



## Boylett (Dec 23, 2006)

In PHP you can use include() to include a file. I need a similar function, except it does it for a string instead.


```
$string = "<?php echo \"something\"; ?>";

include($string);
```
What is this function called (if it exists). I have searched the PHP website but cannot find it.

Thanks.


----------



## Big-K (Nov 22, 2003)

bwuh?


```
<?php

$string = "this is the string";

echo $string;

?>
```


----------



## Boylett (Dec 23, 2006)

Big-K said:


> bwuh?
> 
> 
> ```
> ...


That will echo
<?php echo "something"; ?>

It needs to run it as PHP


----------



## brendandonhu (Jul 8, 2002)

http://php.net/eval


----------



## Boylett (Dec 23, 2006)

Thanks


----------



## brendandonhu (Jul 8, 2002)

[tsg=yourewelcome]yourewelcome[/tsg]


----------

