Posts by Pedro Amaral Couto • 196 points
5 posts
-
0
votes1
answer1922
viewsA: Transform array into XML
The problem is that you are adding the keys of the associative array to "item" plus a number: $key = 'item'.$key; In addition, there is no way to distinguish the attributes of the descending…
-
1
votes1
answer45
viewsA: How to Make an Image with php
If you can put the image to the right, you should also be able to put the background image. With GD, just use the function imagecopy. Of course it should be the first function to be called that…
-
4
votes2
answers2082
viewsA: How to improve the process of generating unrepeated random numbers?
I leave a solution which, in my opinion, has a simple code: <?php class loterias{ public function geraNumero($aQuantidade, $aMinimo, $aMaximo) { if( $aQuantidade > ($aMaximo - $aMinimo) ) {…
phpanswered Pedro Amaral Couto 196 -
3
votes2
answers4711
viewsA: Calendar in PHP
Try: <!DOCTYPE HTML> <html lang="pt-br"> <head> <meta charset="UTF-8"> <title>Calendário em PHP</title> <?php date_default_timezone_set('America/Sao_Paulo');…
phpanswered Pedro Amaral Couto 196 -
0
votes3
answers1481
viewsA: How to not show img element where src is equal to null
Try the following: <?php function removeEmptyImagesFromHtml($html) { $lastUseInternalErrors = libxml_use_internal_errors(true); $dom = new DOMDocument(); $dom->loadHTML($html);…