clanstyles Posted August 8, 2007 Share Posted August 8, 2007 Okay, ive seen this many times before {USERNAME} and that can printout a ausername in php. They use things like that. How does that work? Quote Link to comment https://forums.phpfreaks.com/topic/63973-how-does-this-work/ Share on other sites More sharing options...
ballhogjoni Posted August 8, 2007 Share Posted August 8, 2007 You'll have to explain it a little more Quote Link to comment https://forums.phpfreaks.com/topic/63973-how-does-this-work/#findComment-318876 Share on other sites More sharing options...
teng84 Posted August 8, 2007 Share Posted August 8, 2007 what??? {} if this braces is use within the variable its like your telling PHP that it is variable for some reading ive done it says that it is faster to use that i dont know but thats base on what i read we cant tell because its fast and we cant see the difference and if u can echo this echo TENG; without the"" that means it is define somthing like define('TENG', 'ASTIG') giving the value of teng as astig hmmm does that make sense????? Quote Link to comment https://forums.phpfreaks.com/topic/63973-how-does-this-work/#findComment-318880 Share on other sites More sharing options...
clanstyles Posted August 8, 2007 Author Share Posted August 8, 2007 I tried it it doesn't seem to work. Ive seen template systems using this. Like <td>{USERNAME}</td> It prints out <td>Styles</td> or w/e In php if i tried $username = $_SESSION['USERNAME']; {USERNAME} it doens't do anything it prints out {UERNAME} Quote Link to comment https://forums.phpfreaks.com/topic/63973-how-does-this-work/#findComment-318889 Share on other sites More sharing options...
teng84 Posted August 8, 2007 Share Posted August 8, 2007 in our html template we do this #{value}# almost the same as what you want in h=this case we are using the http://www.php.net/manual/en/function.ob-start.php but im telling you this is not easy you have to have allot of thing to have this work you have to have a regex and etc. anyway the logic is that the html page will be read by the php and get the value inside the {} then add the variable name like in our case if we define this $var[name]='teng'; when the php code read the html it will get the name inside the {} then put the $var[name] it actually the same as echoing in the html like <? echo something?> but for us to have a clean template we do something like this HHHHHHHM does it make sense Quote Link to comment https://forums.phpfreaks.com/topic/63973-how-does-this-work/#findComment-318915 Share on other sites More sharing options...
teng84 Posted August 8, 2007 Share Posted August 8, 2007 BTW they my team mate design this and i believe it will affect the speed of the site because it has to read first the forms before loading so i suggest even if we use this think of other ways LOL Quote Link to comment https://forums.phpfreaks.com/topic/63973-how-does-this-work/#findComment-318918 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.