equivalent to Ruby's -%>
Posted: Wed Apr 16, 2008 2:39 pm
Hi all!
I want dynamically generate yaml file:
When I execute this script from command line, I have output:
Which is completely bad YAML synt
Reason: PHP don't care about white spaces after his tags.
How to avoid this unexpected behavior?
Has PHP equivalent to Ruby's -%>?
I want dynamically generate yaml file:
Code: Select all
Person_User:
<? for ($i = 0; $i < 1; $i++) : ?>
User_Test_<?=$i?>:
login: test<?=$i?>
email: test<?=$i?>@gmail.com
role: admin
zip_code: 44-776
passwd: 1a1dc91c907325c69271ddf0c944bc72
first_name: Michelle
last_name: Briggs
last_login_date: 2008-02-11 06:07:45
<? endfor; ?>
Code: Select all
Person_User:
User_Test_0:
login: test0 email: test0@gmail.com
role: admin
zip_code: 44-776
passwd: 1a1dc91c907325c69271ddf0c944bc72
first_name: Michelle
last_name: Briggs
last_login_date: 2008-02-11 06:07:45
Reason: PHP don't care about white spaces after his tags.
How to avoid this unexpected behavior?
Has PHP equivalent to Ruby's -%>?