skaterdav85 Posted June 8, 2010 Share Posted June 8, 2010 Both are 'correct'. It just depends what you want to do. The first increments before echoing out to the page whereas the second increments after echoing out to the page. Link to comment Share on other sites More sharing options...
Mistress_of_Code Posted May 22, 2011 Share Posted May 22, 2011 In case the tutorial is still being edited, here are my two cents...I know this has been mentioned before several times, but I really would like to see some Object Oriented PHP. The exclusion of it creates a big gap in the tutorial. And also a bit about regular expressions too. Link to comment Share on other sites More sharing options...
jeffman Posted May 22, 2011 Share Posted May 22, 2011 (edited) OOP is a worthwhile concept to discuss, if it is not already there. Meanwhile, look here.Regular expressions are not unique to PHP, so a discussion of them really does not belong in a PHP tutorial. There is some info in the JavaScript section, but an independent tutorial section addressing regex would be better.You might post both these remarks to the suggestions forum, which is, I think, the only forum the site admins ever visit on a regular basis. The other forums are mostly for users. Edited May 22, 2011 by Deirdre's Dad Link to comment Share on other sites More sharing options...
Fmdpa Posted May 23, 2011 Share Posted May 23, 2011 Regular expressions are not unique to PHP, so a discussion of them really does not belong in a PHP tutorial. There is some info in the JavaScript section, but an independent tutorial section addressing regex would be better.Something could be done with regex in the PHP tutorial similar to how SQL was included in the PHP tutorial. It could give a basic intro to RegEx and how to implement it within PHP. Then there could be a more in-depth standalone tutorial. Link to comment Share on other sites More sharing options...
stiner Posted August 2, 2011 Share Posted August 2, 2011 Well, then I guess one php example would be string replacement, for a guestbook or forum, with example of how to detect bbcode sets, split it into three (opentag, data to format, endtag) and replace the opentag and endtag with < and > instead of [ and ]. Link to comment Share on other sites More sharing options...
Ingolme Posted August 2, 2011 Share Posted August 2, 2011 BBcode parseing is pretty much more complex than that because you have to deal with nested or unmatched tags. Link to comment Share on other sites More sharing options...
trinistorm Posted August 5, 2011 Share Posted August 5, 2011 Not going to happen. It would be an enormous security threat to allow people to enter arbitrary server-side code for the server to execute. That goes for both PHP and ASP. There's no try-it editor for ASP code, either. Only client-side code. If you want to execute server-side code you need your own server (or space on someone else's). If you want to set up your own site to allow people to execute their own PHP code, fine, but don't expect your server to stay online very long.A cool try-it might be a simple JavaScript based PHP interpreter one that can handle the basic functions, I mean if this is possible then why not? I'm just throwing in my two cents in case the owners read this I don't actually expect it but if it does happen then hats off. Link to comment Share on other sites More sharing options...
ste Posted August 5, 2011 Share Posted August 5, 2011 Here's a little try-out editor for phphttp://writecodeonline.com/php/ If you try typing in something like phpinfo() and you will see it has blocked any dangerous commands. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 5, 2011 Share Posted August 5, 2011 That's fine for basic stuff, but the number of functions they have to disable means that it's not terribly useful. It is fine for basic things though. Link to comment Share on other sites More sharing options...
jeffman Posted August 5, 2011 Share Posted August 5, 2011 I'm actually working on a tool like that. You install it on your own system, so there are no limitations. I haven't released it yet because it lacks a few bells and whistles. But I've taken to using it all the time when I'm testing new code ideas, and also to solve problems that come up on this board. It's way faster than editing an actual document every time. Since I've been using it, my answers to PHP questions have gotten more thorough with a lot less work. Yay. Link to comment Share on other sites More sharing options...
thescientist Posted August 5, 2011 Share Posted August 5, 2011 (edited) I'm actually working on a tool like that. You install it on your own system, so there are no limitations. I haven't released it yet because it lacks a few bells and whistles. But I've taken to using it all the time when I'm testing new code ideas, and also to solve problems that come up on this board. It's way faster than editing an actual document every time. Since I've been using it, my answers to PHP questions have gotten more thorough with a lot less work. Yay.gives you more time for stuff like this? http://w3schools.invisionzone.com/index.ph...mp;#entry217388 Edited August 5, 2011 by thescientist Link to comment Share on other sites More sharing options...
jeffman Posted August 5, 2011 Share Posted August 5, 2011 (edited) I also need time for my Lindsay Lohan Fan Club page. Edited August 5, 2011 by Deirdre's Dad Link to comment Share on other sites More sharing options...
thescientist Posted August 5, 2011 Share Posted August 5, 2011 clearly... Link to comment Share on other sites More sharing options...
trinistorm Posted August 5, 2011 Share Posted August 5, 2011 (edited) Here's a little try-out editor for phphttp://writecodeonline.com/php/If you try typing in something like phpinfo() and you will see it has blocked any dangerous commands.That is a decent attempt but not very practical . If it were purely JavaScript based you could enable a lot more functions and worry less about server side security. Hmmm, a try-it editor browser plugin might be even cooler. I think I'll write that down.I'm actually working on a tool like that. You install it on your own system, so there are no limitations. I haven't released it yet because it lacks a few bells and whistles. But I've taken to using it all the time when I'm testing new code ideas, and also to solve problems that come up on this board. It's way faster than editing an actual document every time. Since I've been using it, my answers to PHP questions have gotten more thorough with a lot less work. Yay.That sounds cool DD what language are you writing it in? Edited August 5, 2011 by sansana Link to comment Share on other sites More sharing options...
jeffman Posted August 5, 2011 Share Posted August 5, 2011 Maybe I should have explained. The front end is HTML and AJAX. The back end is PHP. When you strip away all the safety features, error filtering, and a few other tweaks, the central function is -- wait for it -- eval.My goal wasn't to write a minimal PHP interpreter (cool, but not me) but to write a web-based PHP terminal. I wanted it to have access to all PHP features on my server, so it's no good as a W3Schools-type "try-it".OTOH, the way it speeds up workflow, I think it's a good learning tool. I built in ways to send get, post, cookie, and custom header data in addition to the code, so you can simulate just about everything. You can even look at the response headers. Link to comment Share on other sites More sharing options...
trinistorm Posted August 6, 2011 Share Posted August 6, 2011 The forbidden eval. So it provides you with remote access allowing you to run scripts and you can condition the environment using various headers with the code? Thats pretty cool, I'm getting a picture similar to a JavaBean program I ran across once that provided you with a web based terminal and allowed you to execute java code. Link to comment Share on other sites More sharing options...
isttoptan Posted August 16, 2011 Share Posted August 16, 2011 thank you, nice sharing.. Link to comment Share on other sites More sharing options...
moriahcgibbs Posted January 7, 2012 Share Posted January 7, 2012 I am currently trying to learn php. i found the php tutorial to be helpful with simple concepts and getting the basics down, but in my opinion there should be more examples of practical applications of php in the tutorial. I think that would be very helpful. Link to comment Share on other sites More sharing options...
elizeb Posted January 19, 2012 Share Posted January 19, 2012 (edited) Even though I am a master in html and cms part of the web, I am still a newbie in php. So I searched your site, but failed to find enough information on php coding.I appreciate that the admin itself noticed it, waiting for much improved articles on php. Edited January 19, 2012 by elizeb Link to comment Share on other sites More sharing options...
metallicrazy Posted January 25, 2012 Share Posted January 25, 2012 (edited) I don't know if it is an old idea or a new one, but is it possible to create a Try-it editor for PHP? Maybe eval() could be used for that, like eval($_POST['php_input']);Of cource with limitations I am trying to create a comprehensive php e-learning environment for my honours project that will have a "try it yourself" editor. (limited of course). If you want to help me build the security and be part of my testing focus group, please see my forum page. http://w3schools.inv...l=&fromsearch=1 Edited January 25, 2012 by metallicrazy Link to comment Share on other sites More sharing options...
pukster Posted March 7, 2012 Share Posted March 7, 2012 I suggest checking out this article over at StackExchange. The OP addresses several issues that all PHP tutorials have http://stackoverflow.com/questions/2119083/php-tutorial-that-is-security-accuracy-and-maintainability-conscious#comment12179568_2119083 Link to comment Share on other sites More sharing options...
astralaaron Posted March 21, 2012 Share Posted March 21, 2012 (edited) Reference for available short hand options!? for example //longif(false == $something)//shortif(!$something) //long if(1 < 2) {$result = true;} else {$result = false;} //short$result = (1 < 2) ? true : false; I am suggesting this because this type of stuff really confused me when I was new and trying to learn from examples, often times the examples would write things in short hand. When you are new to programming anything foreign to you is very intimidating. This would be a great addition. Edited March 21, 2012 by astralaaron Link to comment Share on other sites More sharing options...
astralaaron Posted March 21, 2012 Share Posted March 21, 2012 (edited) I have one other idea from all of the posts about a "try it yourself editor" for PHP. I think that a major problem most people who are learning have is learning to debug their own syntax errors. It would be really cool (and I can't think why not possible) to make something similar to a try it editor but it is instead a crash course for debugging syntax errors. There could be general descriptions of the different possible errors, and then a generator that would write out a block of code with an error that the user would need to look through, identify the error, and correct it. The correct version could be stored into a session or something sort of like a Captcha to determine if they corrected the errors EDIT: It would also be very helpful if methods were shared as far as how a good programmer would work through their code to determine where an error is and how to identify the problem line. Edited March 21, 2012 by astralaaron Link to comment Share on other sites More sharing options...
justsomeguy Posted March 21, 2012 Share Posted March 21, 2012 Instruction on debugging would be useful, a lot of people don't understand how to do it. It's a requirement for programming that a lot of people don't understand for some reason, but I'm not sure why. Most of how I debug is just what makes sense to me, rather than following a particular method. Syntax errors are obviously the easiest to debug, because it tells you right where the error is. Logic errors are harder to debug and usually require you to print out where the code is going and what the data is that it's working with so that you can figure out where the problem is. 1 Link to comment Share on other sites More sharing options...
amirfreed Posted March 30, 2012 Share Posted March 30, 2012 Actually i comes over here when i want to learn php and i didn't know any thing about php. I have some little difficulty in learning php which is language, If you want to make little bit more efficient work to make your php side in different languages then this is one of the best place to learning every thing, well this is only suggestion if you like then thanks, Otherwise No problem do it as you know bettor Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now