I have an issue.

I am generating a php file with some contents in it such as an array.
The array values are coming from database values.
The array is as follows:

PHP Code:
$array = array('key' => 'key_name''value' => 'db_value'); 
However, the db_value needs to be able to not break the php code such as special characters like !"$%^&*();'@:][{}#~?><,./

Because the array 'Value' contents is wrapped in '' (single quotes) I am thinking that there could be a possibility of it breaking the php code and making the array not work.

Whats your thoughts on this?

Thanks for your help.