php Programming Glossary: so
Reference - What does this error mean in PHP? http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php programming PHP and have no clue how to fix. This is also a Community Wiki so everyone is invited to participate in adding.. and have no clue how to fix. This is also a Community Wiki so everyone is invited to participate in adding to and maintaining.. Other users having the same error can not easily read the solution out of it because they are too localized. That is sad..
Why shouldn't I use mysql_* functions in PHP? http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php I use mysql_ functions in PHP What are the technical reasons that I shouldn't use mysql_ functions like mysql_query mysql_connect.. on my site This question serves as a canonical information source regarding the discouraged use of ext mysql. Its purpose.. this question Ease of use The analytic and synthetic reasons were already mentioned. For newcomers there's a more significant..
Are PHP short tags acceptable to use? http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use and off from the php.ini configuration file. As such while some people find short tags and ASP style tags convenient they.. echo The programmers convenience is an important factor so why are they not recommended php coding style php shorttags.. chuck in spaces eg php or I don't buy readability as a reason at all. Most serious developers have the option of syntax highlighting..
UTF-8 all the way through http://stackoverflow.com/questions/279170/utf-8-all-the-way-through need to configure Apache MySQL and PHP to do this is there some standard checklist I can follow or perhaps troubleshoot where.. application transmits text to other systems they will also need to be informed of the character encoding. With web applications.. sure that every time you process a UTF 8 string you do so safely. This is unfortunately the hard part. You'll probably..
Robust and Mature HTML Parser for PHP [duplicate] http://stackoverflow.com/questions/292926/robust-and-mature-html-parser-for-php it can do XPath queries . It is based on libxml . It takes some time to get productive with DOM but that time is well worth.. interface you'll find implementations in many languages so if you need to change your programming language chances are.. extension has been covered extensively on StackOverflow so if you choose to use it you can be sure most of the issues you..
How do you parse and process HTML/XML in PHP? http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php it can do XPath queries . It is based on libxml . It takes some time to get productive with DOM but that time is well worth.. interface you'll find implementations in many languages so if you need to change your programming language chances are.. extension has been covered extensively on StackOverflow so if you choose to use it you can be sure most of the issues you..
Reference - What does this symbol mean in PHP? http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php come up every now and then about syntax in PHP. This is also a Community Wiki so everyone is invited to participate in maintaining.. then about syntax in PHP. This is also a Community Wiki so everyone is invited to participate in maintaining this list... is to have links to existing questions on Stack Overflow so it's easier for us to reference them not to copy over content..
Secure hash and salt for PHP passwords http://stackoverflow.com/questions/401656/secure-hash-and-salt-for-php-passwords Hashing a password a million times may be safer but also slower. How to achieve a good balance between speed and safety.. How to achieve a good balance between speed and safety Also I'd prefer the result to have a constant number of characters... equally good Is there any way to generate good salts Also should I store two fields in the database one using MD5 and..
Headers already sent by PHP http://stackoverflow.com/questions/8028957/headers-already-sent-by-php information headers already sent by output started at some file.php 12 in some file.php on line 23 The lines mentioned.. already sent by output started at some file.php 12 in some file.php on line 23 The lines mentioned in the error messages.. contain header and setcookie calls. What could be the reason for this and how to fix it php header share improve this..
How to get useful error messages in PHP? http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php bracket missing semicolon or a failed function call or something else entirely. It is very difficult to figure out what.. want to change. If you can't modify the php.ini you can also add the following lines to an .htaccess file php_flag display_errors.. checks for errors why you type such as PhpEd . PhpEd also comes with a debugger which can provide more detailed information...
Reference - What does this error mean in PHP? http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php The root cause of those questions is always the same. So the answers to those questions typically repeat them and then..
Why shouldn't I use mysql_* functions in PHP? http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php it's even shorter pdo_query INSERT INTO pages VALUES _POST So much simplicity. But let's get back to some more rewriting advises.. mysql_ usually provide after failed queries. Other options So this hopefully visualized some practical reasons and a worthwile..
Reference - frequently asked questions about PDO [closed] http://stackoverflow.com/questions/15990857/reference-frequently-asked-questions-about-pdo statements and error handling in PDO are quite frequent. So this is just a place where all them can be found. What should.. on connection errors too which is very important. So here is an example for creating a PDO connection right way dsn..
Robust and Mature HTML Parser for PHP [duplicate] http://stackoverflow.com/questions/292926/robust-and-mature-html-parser-for-php However not all 3rd party libs go down this route. Some of them listed below SimpleHtmlDom An HTML DOM parser written.. A HTML beautifier like HTML Tidy Minify CSS and Javascript Sort attributes change character case correct indentation etc... but there can be quirks due to the markup HTML5 allows. So for HTML5 you want to consider using a dedicated parser like..
What is the difference between single-quoted and double-quoted strings in PHP? http://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php a back slash you can escape it with another backslash So yes even single quoted strings are parsed . Double quote strings..
How do you parse and process HTML/XML in PHP? http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php However not all 3rd party libs go down this route. Some of them listed below SimpleHtmlDom An HTML DOM parser written.. A HTML beautifier like HTML Tidy Minify CSS and Javascript Sort attributes change character case correct indentation etc... but there can be quirks due to the markup HTML5 allows. So for HTML5 you want to consider using a dedicated parser like..
Secure hash and salt for PHP passwords http://stackoverflow.com/questions/401656/secure-hash-and-salt-for-php-passwords access to user accounts by compromising the database. So the goal of password hashing is to deter a hacker or cracker.. is always the safest but least memorable solution. So far as I've been able to tell making the world's best password..
Who needs singletons? [closed] http://stackoverflow.com/questions/4595964/who-needs-singletons db db query '...' But it's considered as a bad practice. So after a little search I ended up with the Singleton pattern.. about db anymore. But maybe I'm forgetting something. So who's wrong who's right php oop design patterns singleton .. testing And honestly this is the same as the first issue . Sometimes you want to replace your database with a mock database...
How do I expire a PHP session after 30 minutes? http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes 4.2.3 it has used mtime modified date instead of atime. So you won't have problems with filesystems where atime tracking.. with filesystems where atime tracking is not available. So it additionally might occur that a session data file is deleted.. server ™s task to invalidate a session not the client ™s. So this doesn ™t help anything. In fact having session.cookie_lifetime..
Call to a member function on a non-object http://stackoverflow.com/questions/54566/call-to-a-member-function-on-a-non-object to a member function on a non object So I'm refactoring my code to implement more OOP. I set up a class.. Call to a member function set_page_title on a non object So what am I missing php php errors share improve this question..
Headers already sent by PHP http://stackoverflow.com/questions/8028957/headers-already-sent-by-php headers already sent output started at file line Some functions modifying the HTTP header are header header_remove.. title PHP page output page title head body h1 Content h1 p Some more output follows... p and a href img src about note ..... They don't visualize it obliged by the Unicode standard . Some programmer and console editors however do There it's easy..
How to get useful error messages in PHP? http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php the problem. But there surely must be a better way right . So is there a way to get PHP to produce useful error message like..
How to successfully rewrite old mysql-php code with deprecated mysql_* functions? http://stackoverflow.com/questions/10919277/how-to-successfully-rewrite-old-mysql-php-code-with-deprecated-mysql-functions right The same with functions like public function connect SO only whats left is public function selectDb database but i have..
PHP Create a Multidimensional Array from an array with relational data [duplicate] http://stackoverflow.com/questions/11239652/php-create-a-multidimensional-array-from-an-array-with-relational-data name Amy Martin parent 6037 I need it to be in this JSON format id 5273 name John Doe data children id Sally Smith.. relationships v 'id' v 'parent' I think based off another SO post used this relational data to create a the new multidimensional..
PHP curly brace syntax for member variable http://stackoverflow.com/questions/1147937/php-curly-brace-syntax-for-member-variable curly brace syntax for member variable First question on SO and it's a real RTFM candidate. But I promise you I've looked..
algorithm that will take numbers or words and find all possible combinations http://stackoverflow.com/questions/1256117/algorithm-that-will-take-numbers-or-words-and-find-all-possible-combinations be cat dog cat fish dog cat dog fish fish cat fish dog SO the results from the set of 3 items are 6 possible variations..
How to Use AJAX in a WordPress Shortcode? http://stackoverflow.com/questions/13498959/how-to-use-ajax-in-a-wordpress-shortcode so ajax shortcode so ajax shortcode.php php Plugin Name SO Ajax Shortcode Description Demonstration of WordPress Ajax working.. License GPLv3 add_action 'plugins_loaded' array B5F_SO_13498959 get_instance 'plugin_setup' class B5F_SO_13498959 private.. B5F_SO_13498959 get_instance 'plugin_setup' class B5F_SO_13498959 private cpt 'post' # Adjust the CPT protected static..
PHP tutorial that is security-, accuracy- and maintainability-conscious? [closed] http://stackoverflow.com/questions/2119083/php-tutorial-that-is-security-accuracy-and-maintainability-conscious supposed to be explicitly about security. As questions on SO have proved it is difficult to fix people's miunderstanding..
UTF-8 BOM signature in PHP files http://stackoverflow.com/questions/2558172/utf-8-bom-signature-in-php-files on Wikipedia and on some other similar questions here on SO. I know that it adds some things at the beginning of the file..
PHP_SELF vs PATH_INFO vs SCRIPT_NAME vs REQUEST_URI http://stackoverflow.com/questions/279966/php-self-vs-path-info-vs-script-name-vs-request-uri Thanks for your help Note I've had to add spaces as SO sees the underscore and makes it italic for some reason. Updated..
PHP emitting 500 on errors - where is this documented? http://stackoverflow.com/questions/3075355/php-emitting-500-on-errors-where-is-this-documented 500s before. According to various quotes and answers on SO and elsewhere it seems to indeed be PHP's default behaviour..
PHP Loginsystem: Remember Me http://stackoverflow.com/questions/3128985/php-loginsystem-remember-me you are already logged in that's how I want it.. Just like SO gmail and so on i can make the list long.. It's a normal login..
Simple test vs PHPunit http://stackoverflow.com/questions/34312/simple-test-vs-phpunit and you will be able to find help pretty much anywhere SO #phpunit irc channel on freenode pretty much every php developer..
Insert/update helper function using PDO http://stackoverflow.com/questions/3773406/insert-update-helper-function-using-pdo hope it can be easy enough to be used as an answer here on SO. Because in the every topic we can see prepared statements usage..
Preserve key order (stable sort) when sorting with PHP's uasort http://stackoverflow.com/questions/4353739/preserve-key-order-stable-sort-when-sorting-with-phps-uasort question is actually inspired from another one here on SO and I wanted to expand it a bit. Having an associative array..
Publishing To User's Wall Without Being Online/Logged-in - Facebook Sharing Using Graph API http://stackoverflow.com/questions/4814432/publishing-to-users-wall-without-being-online-logged-in-facebook-sharing-usin message #200 This API call requires a valid app_id. EDIT SO THAT SOMEONE MAY FIND USEFUL FACEBOOK CONNECTION facebook_connect.. #200 This API call requires a valid app_id. EDIT SO THAT SOMEONE MAY FIND USEFUL FACEBOOK CONNECTION facebook_connect array.. redirect_uri YOUR_URL scope publish_stream state SOME_ARBITRARY_BUT_UNIQUE_STRING PHP SDK loginUrl facebook getLoginUrl..
How to prevent SQL injection with dynamic tablenames? http://stackoverflow.com/questions/5811834/how-to-prevent-sql-injection-with-dynamic-tablenames
Storing arrays in the database http://stackoverflow.com/questions/7364803/storing-arrays-in-the-database a terrible practice. Please refrain from inserting CSV JSON serialize or ANY kind of serialized data in a relational database... especially in light of the plethora of questions asked on SO that would be avoided if they did the right way. Here's the..
How to check IF user has ALREADY liked the facebook page? http://stackoverflow.com/questions/7397724/how-to-check-if-user-has-already-liked-the-facebook-page greyed out like button edit Guys I've researched this on SO and have found similar questions but not quite what I'm after...
Encrypt php code http://stackoverflow.com/questions/764927/encrypt-php-code coder Gridinsoft IonCube SA Encoder.php Another thread on SO that adds a few more check it out http stackoverflow.com questions..
PHP, Simplest Two Way Encryption [closed] http://stackoverflow.com/questions/9262109/php-simplest-two-way-encryption this question This is a simplified answer to another SO question made by somebody else the question has since been deleted...
|