Questions tagged as 'php'

3
answers

Arrange array in alphabetical order

When I want to sort an array alphabetically based on an array field I do this: // Compara se $a é maior que $b function cmp($a, $b) { return $a['nome'] > $b['nome']; } // Ordena usort($produtos, 'cmp'); This works perfectly, but I w...
asked by 31.08.2018 / 15:20
1
answer

WebSocket giving creation error

I'm having trouble, when trying to run the websocket, it returns me the following error in the image ThecodeI'musingisthis:<?php$ip='localhost';$porta=8080;//-------------------------------$servidor=socket_create(AF_INET,SOCK_STREAM,SOL_T...
asked by 26.06.2018 / 22:06
1
answer

How to assign a number to each placement

I'm doing a page where it shows the rankings of users with more X and Y, everything is shown inside the site in a table where there is the name of each user and the amount of X he has, but I do not know how to put for example: 1 or 1. Robson 100...
asked by 30.06.2018 / 02:48
2
answers

Address / class / method validations

Scenario I use a method to instantiate classes and methods dynamically. Properties received: modulo = name of folder with files .class.php ferramenta = name of file .class.php acao = name o...
asked by 04.12.2018 / 12:57
1
answer

problems with (array) object

I have a array of objects . Ex: $array = array (1=$obj1, 2=$obj2...ect) It turns out that I'm converting these objects into arrays also to have an array of arrays instead of a Array of objects with the purpose of transformin...
asked by 03.12.2018 / 14:05
1
answer

How to leave the date with Brazilian standard in Codeigniter 3?

I'm developing an application that takes the registration date of the registry. But is getting the date with American standard YYYY / mm / dd how do I correct this in codeigniter? Here is an example of my code. minha página html <d...
asked by 05.12.2018 / 20:33
2
answers

How do I display Google Analytics results on my website?

I've been using Google Analytics for some time, but now I wanted to show the results on one page. I'm having some problems noticing how it works. I would like you to advise me a guide / tutorial or to explain how to use it.     
asked by 28.02.2014 / 11:49
1
answer

Notice: Undefined offset looking inside array with for

Hello My code is a calendar and it works as follows, there is an array with some times inside: $horarios = ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00"]; I then do a SELECT on the database loo...
asked by 15.05.2018 / 16:09
3
answers

How to join values in common php array?

I have the array $vetor[0]['codigo'] = '1'; $vetor[0]['valor'] = '4'; $vetor[1]['codigo'] = '1'; $vetor[1]['valor'] = '2'; $vetor[2]['codigo'] = '2'; $vetor[2]['valor'] = '2'; I need to merge all values with equal codes. Doing the ab...
asked by 16.05.2018 / 18:04
2
answers

Validate fields with jQuery

I have a function in jQuery , which when the user clicks the next button it triggers an email. When I click the button, I need to verify that the Name , Email and Phone fields have been filled out and, if not completed, low input...
asked by 16.05.2018 / 18:33