Questions tagged as 'php'

1
answer

How to use a try catch within another?

I need to write data to a database, and if it succeeds, then I will generate a .pdf with PHP. Even though I put try catch in a part of the code and it gives exception , still the rest of the code will be executed. Would it...
asked by 03.10.2014 / 16:45
2
answers

Is there a difference between strtr and str_replace?

I was looking at how the strtr and str_replace functions behaved and I noticed that, at first glance, the two seem to do exactly the same thing. Example: $translators = [ 'da hora' => 'bacana', 'ser' => 'é', ]; $st...
asked by 27.02.2015 / 13:30
5
answers

Save in the database the binary content of an image

How do I get the bytecode of an image at upload time to be able to store it in the mysql blob field without the need to save the image to ftp?     
asked by 04.12.2014 / 15:50
2
answers

What is a language constructor?

In PHP, I've read and heard many times about Language Builders. The cases I've heard of them have been in cases where it was said "you'd rather use X instead of Y, since Y is a function and X is a language constructor." One of the cases I've...
asked by 30.08.2018 / 14:35
1
answer

What is type juggling?

What does the term type juggling refer to? Is it related to dynamic typing languages such as PHP and JavaScript?     
asked by 17.12.2018 / 22:30
2
answers

What is the purpose of the Model folder of the Inphinit framework?

In the Inphinit micro-framework there is the Model folder that is inside the application , and that's where classes , but I'm very confused about these classes. View a class inside the Model folder: <?php namespace Model; class User...
asked by 15.03.2017 / 02:23
1
answer

PSR-4 in an MVC project or not?

I have two codes, the first one uses spl_autoload_register and the other does not, however the second one loads "automatically the class" as well. With spl_autoload_register Uses namespaces to split MVC You can create multiple le...
asked by 10.08.2015 / 22:18
1
answer

Progressive and cumulative hours counter with days

I have a project where I must accumulate hours worked for a service in a project, it should store in the bank the hours / days. Then when started, if there is no previous time it starts from zero, but if there has already been a step previous...
asked by 07.12.2015 / 13:14
1
answer

Remove accents from a string in php [duplicate]

To have problems with the accents in my code and wanted to remove the accents when doing the search, Ex: Search: Hello | Hello. When doing a Music search on the site it returns the url like this: search.php? q = Music And it does no...
asked by 05.02.2015 / 23:51
5
answers

Explode with name indexes (associative)

How can I make a explode in a variable where I can then access it by nominal index , and not by numeric index ? Follow the example to get clearer: <?php // Aqui acesso pelo índice $user = "Diego:25:RJ"; $info = explode(":",$u...
asked by 25.08.2016 / 18:15