Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 8 cze 2011 · I'm a beginner PHP coder, recently I've been told I indent my code not correctly. They say this is wrong: if($something) { do_something(); } else { something_more(); and_more(); }

  2. I noticed that in some places there are no line breaks on the outputted html and in some places there is excess indentation. For example take the following code, where I have preserved the indentation from the source file:

  3. Indentation. Spacing and indentation should be consistent throughout your code. Many developers choose to use 4-space or 2-space indentation. In PHP, each nested statement (e.g., a statement following a " {" brace) should be indented exactly once more than the previous line's indentation.

  4. So notice how I nested HTML within the PHP code by escaping w/ the PHP syntax. This can get out of hand if you have lines and lines of code. I'm using Komodo and I've enabled "Indentation Guidelines" but even with that, most of my code doesn't line up.

  5. 29 lip 2024 · Learn how to format your PHP code with indentation, line breaks, and whitespace. Discover coding standards and tools to improve your code readability and quality.

  6. 16 lut 2019 · Indenting and Line Length. Use an indent of 4 spaces, with no tabs. This helps to avoid problems with diffs, patches, SVN history and annotations. For Emacs you should set indent-tabs-mode to nil. Here is an example mode hook that will set up Emacs (ensure that it is called when you are editing PHP files): (defun pear/php-mode-init()

  7. 8 mar 2018 · There is no "better" indentation style, it's a matter of personal preference, though most of the PHP world uses four spaces as indentation because it follows the PSR-2 Coding Standard Guide, which only allows using four spaces.

  1. Ludzie szukają również