I am trying to add one line of code to a file so that I can multiple files in one location with the name example_com.php here is the basic idea what I am trying to do <?php $string2 = str_replace('www.','' , '.','_',$_SERVER['HTTP_HOST']); include $string2.php; ?> PHP: I am having an issue with the include its removing both dots I need it to remove only one and include the corresponding files.
Actually I don't quite understand what you after is. what do you expect from the following code: <?php $string2 = str_replace('www.','' , '.','_',$_SERVER['HTTP_HOST']); include $string2.php; ?> Code (markup): I prefer use this: <?php $string2 = str_replace('www.','',$_SERVER['HTTP_HOST']); include("{$string2}.php"); ?> Code (markup): But the result of the code is try to include any hostname that you place the code. For example: If you place the code in www.xx.com, then the code will include file xx.com.php Please give the detail information