Questions tagged as 'php'

1
answer

Count characters string

I am counting the characters of a string in PHP. The content of the string is: 10,12,12,22,33. I want to scroll to print one by one and with a "\ n". The problem is that I use strlen, and it counts all the characters including the commas. I want...
asked by 17.12.2014 / 11:46
3
answers

User Authentication with Laravel 4

I'm starting to authenticate users with Laravel 4 as a basis for this link . My doubt and the next, every route, I have to use this way? Route::get('/', array('before' => 'auth'), 'HomeController@index'); I mean, do I have to ent...
asked by 03.07.2014 / 16:52
2
answers

How to run a PHP application in IIS?

I have a website in PHP that I want to install on IIS (Apache for Windows is not an option). It will not run naturally as a .NET application. So I've already downloaded a PHP release on link , but I still have to configure IIS to interpret...
asked by 23.06.2014 / 18:48
3
answers

How to return most common words in a text with PHP?

I'd like to know how best to return the most frequent occurrences of substrings in a string containing text. Example: $texto = "Hoje nós vamos falar de PHP. PHP é uma linguagem criada no ano de ..."; And the output: array( "PHP" =>...
asked by 29.06.2014 / 20:55
3
answers

Call Java application via PHP

I created a Java application here in my company however they want to call this application in Java via a website made in PHP. I would like to know if it is possible for me to make a PHP code that calls a Java application, no matter the form if i...
asked by 09.06.2015 / 15:27
3
answers

How to deal with multiple queries?

I have a question regarding good programming practice. How to handle multiple queries on a single page in PHP. For example, the code: $qr = "SELECT historico.*, funcionarios.nome FROM historico INNER JOIN funcionarios ON (historico.funcion...
asked by 20.05.2014 / 04:59
2
answers

What is the difference between joining an array via sum operator and the array_merge function?

To join two arrays in a new array in PHP, we can do it through the array_merge function or through the sum operator ( + ). In this case we have two examples: $a = ['stack' => 'overflow']; $b = ['oveflow' => 'stack'...
asked by 27.02.2015 / 14:24
4
answers

Deleting files inside a folder

I want to delete all files and subfolders within a folder, but without deleting it, using PHP. How can I do this?     
asked by 29.03.2015 / 23:47
1
answer

A product in Various Categories - PHP

Would you like to know how to link a product into several categories? For example: A shirt may be in the "Green / Blue / Yellow" categories and when I filter by category the product should appear in the "Green, Blue or Yellow" category. I kno...
asked by 30.03.2015 / 20:51
2
answers

How to use echo in a query with prepared statement?

I would like to know how to use echo in a query with prepared statement, to be able to see how it was mounted by php before it was executed, thus facilitating visualization of the error when bind_param is done ... Example: $Apagar = $conn-&...
asked by 11.03.2014 / 19:43