Questions tagged as 'php'

1
answer

Difference between Pipes, Fork and Threads

From this question , I came to the curiosity of wanting to learn more about the subject, then researching more deeply, I came across with more doubt on the subject. I've seen a string of ways to use Threads. We can see the threads as small p...
asked by 02.08.2016 / 15:47
2
answers

CodeIgniter + PagSeguro

I'm having a hard time integrating a system with pagseguro using codeigniter. I've already downloaded the official pagseguro library. link I have already created a controller with all the data (in this case for a test); function pagseg...
asked by 24.07.2015 / 16:38
5
answers

Optimize function to include classes also looking in sub-directories

I have the following function to include classes when we are trying to use a class that has not yet been defined: /** * Attempt to load undefined class * @param object $class_name object class name */ function __autoload($class_name) {...
asked by 16.01.2014 / 16:40
3
answers

Add custom timezones in PHP?

TL; DR Is there any way to add custom timezones in PHP? Objective I would like to be able to record a timezone (using new DateTime(...) ) with an arbitrary timezone value, such as 13 minutes , 51 minutes , or 3 hours and...
asked by 12.01.2014 / 07:06
1
answer

How to use namespace in a Class?

I'm using the AWS SDK for PHP from Amazon and for this I need the class S3Client . I was seeing an example upload to amazon and did so: require '../aws/aws-autoloader.php'; use Aws\S3\S3Client; $s3 = S3Client::factory($config);...
asked by 11.11.2014 / 13:37
3
answers

Receive array and write multiple rows in MySQL

I have the following form in HTML: <h2>Sessao 1</h2> <input type="text" name="ipl[]" class="span12 "> <input type="text" name="spot[]" class="span12 "> <input type="text" name="energia[]" class="span12 "> <inpu...
asked by 23.10.2014 / 07:17
2
answers

How to perform methods overload with PHP?

How to perform overloading of methods with PHP? In order to declare methods with the same name but with different parameters.     
asked by 12.02.2015 / 18:05
3
answers

What is the purpose of the __clone magic method?

In PHP we have the magic method __clone . It is used to define behavior when you clone an object through the keyword clone . So far so good. But I do not quite understand why having this magic method, since the word clone p...
asked by 30.06.2016 / 15:47
1
answer

Send email with attachments in php

I'm sending an email, everything works fine. Now I wanted to add some files as an attachment. I have the following code: $from = $_SESSION['email_cliente']; $email_destino = "[email protected]"; $subject = "Assunto"; $messagem = "Isto é uma mens...
asked by 02.04.2014 / 15:59
4
answers

How to create a function to page dynamically created PHP page and change certain text

I have a PHP page that is dynamically mounted, and I need to change certain texts, depending on the user being male and female. I was using it like this: function mudasexocaps($sexo) { if ($sexo == "feminino") { echo "A"; }...
asked by 11.11.2015 / 18:28