Posts by william.web • 87 points
5 posts
-
0
votes4
answers1229
viewsA: How do you know if a certain day is a weekend?
You can do so too. <?php function checkDayFDS($day){ $nameDay = date("D", strtotime($day)); $fds = "Hoje não é final de semana<hr>"; if ($nameDay == "Sat" || $nameDay == "Sun"){ $fds =…
-
1
votes3
answers2608
viewsA: Problem using include php different folders
I think you better always go to the server root, then from there you use the path. /css/materialize.min.css"> This is a good practice in case you are going to call this file from several…
-
0
votes2
answers50
viewsA: Delete and recreate variables in the same scope of different functions
You can do these functions within a class and create the class variable itself $this->XXX or you can also turn into a constant defined in this way define("NOME_DA_CONSTANTE",…
phpanswered william.web 87 -
-1
votes4
answers8313
viewsA: Is using addslashes against SQL injection safe?
You can also use preg_replace() this way: $text = "090933ojeoejf'@#$%"; /* Para deixar apenas letras */ $text = preg_replace("/[^[:alpha:]_]/", "", $text); /* Para deixar letras e números */ $text =…
-
7
votes3
answers17172
viewsA: How to pick up content within a string up to a "bar/" character
Use the substr function(); It takes the content up to the bar and continues as a string; $text = "123456/efineinfe"; $text = substr($text, 0, strpos($text, "/"));…
phpanswered william.web 87