Posts by Douglas de Souza • 174 points
8 posts
-
0
votes1
answer610
viewsA: Pass multidimensional array to php
If you use an index string, when accessing an array, Javascript will reset the array to a default object, and all methods and properties of Array will produce undefined or incorrect results. Behold:…
-
2
votes1
answer1378
viewsA: Change navbar style with scroll
You can make a javascript for the scroll event. See this example, which puts the fixed navbar at the top only when the scroll scrolls to the top of the navbar: $(function(){ // var navbarTop =…
-
1
votes1
answer744
viewsA: How to treat exception released "Integrity Constraint Violation: Cannot delete or update a Parent Row: a Foreign key Constraint fails"?
There are cases where the getCode() da Pdoexception does not return the correct code. In this case I use: try { .... } catch (PDOException $e) { if (isset($e->errorInfo[1]) &&…
-
4
votes1
answer216
viewsA: How does the reference to undeclared variables work in PHP?
If you assign, pass, or return an undefined variable by reference, it will be created. http://php.net/manual/en/language.references.whatdo.php A PHP variable is stored in a container called "zval".…
-
-1
votes8
answers7818
viewsA: Check if variable contains a well formatted PHP email address
This function returns true if the $email informed fits the standard set in regex: [email protected] function valida_email($email) { return…
-
2
votes3
answers2416
viewsA: Use or not use bar at the end of a URL?
When it comes to the domain’s main URL, I think it’s unnecessary to put the bar at the end, since some browsers like Chrome already remove the bar automatically from the address bar: See the…
-
1
votes2
answers1000
viewsA: Warning: Module 'mcrypt' already Loaded in Unknown on line 0
Check that in your php.ini file there is more than one call to the mcrupt extension. Look for extension=mcrypt in the archive. On your platform (Max OS X) I think the PHP configuration file can be…
-
3
votes4
answers20996
viewsA: Difference between null, Empty, 0 and false
NULL Indicates that a variable has no value. A variable is considered NULL if it has been assigned as NULL (special value), or if a value has not yet been assigned to the variable. Empty It is a…