string - preserving text format php for UserData -


my problem seems simple stuck.

i have template file has content below:

#!/bin/sh      sudo -s;     touch /tmp/{{key}} 

my requirement have read file replace key value , pass userdata input aws php sdk .

how after running

$key = "{{key}}"; $value ="test1.txt"; $filecontent = file_get_contents($templatepath); str_replace("{{" . $key . "}}", "$value", $filecontent); 

to above file content format lost. generates follows

#!/bin/sh sudo -s;touch /tmp/test1.txt 

i lost format , sdk not understand bash script


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -