how to convert value to string in php code example Example 1: integer to string php return strval($integer); Example 2: convert to string php echo "'$animal'";