Questions tagged as 'php'

1
answer

namespace with php [duplicate]

I'm trying to get deeper into namespace , but in the ways I'm trying, it's giving error . Here are two ways: My class that falls within the classes / class.php directory namespace minhaClasse; class classe { public function t...
asked by 06.11.2016 / 01:18
3
answers

Use out-of-function variables

I'm studying php7 and I've seen somewhere that it's now possible to use external function variables, but they're in the same file. From what I remember it was something like this: <?php $agua = '1 Litro'; function listaDeCoisas($item1,$it...
asked by 26.12.2016 / 22:36
2
answers

Checking parameters in MVC

In the MVC Standard, the Model is responsible for the business layer, in which will be the business rules and validations. I have a question about the following. A method in the controller that receives any parameter (it can be a primitive type...
asked by 22.02.2015 / 21:51
2
answers

Is there any way to debug PHP via the browser console?

Is there any way to debug PHP via the browser console? I sometimes want to debug a value on the system in production, but I do not want the user to notice it. Then I had the idea of using the browser console. You can do something like this...
asked by 06.11.2015 / 14:23
4
answers

Find character in string

How to find the position of a given character, where the string has many of these characters in the same string, eg find the 3rd letter X in the string Y. some way to do this?     
asked by 16.02.2015 / 16:51
2
answers

Test if an input of the type radiobutton is selected in PHP

I created a table that is the summary of all my previous calculations and in this table I created a field where I placed a radial input to be able to select one of the calculated options. I need to identify which of the inputs was clicked, using...
asked by 17.11.2015 / 16:48
1
answer

Send email with Accents BD Uft8

I have a problem sending email with names that come from the database. Some names come with accents and when I get the emails the names are unconfigured. The database is like Utf8 - Default collation Code php: $PHPMailer->Charset = 'U...
asked by 25.06.2014 / 10:58
3
answers

Date in the format dd / mm / yyyy?

I created a table, where I put the user's registration on a card for printing; so this table has several records (5 per page) and for each page I access a record in the same table I made an array_push with values -> $sql = mysql_query("SELECT...
asked by 19.08.2014 / 23:51
1
answer

Place Authorization: Basic on api

I'm creating an API as I said, and I need to use Authorization: Basic KEY to send login and password via header. Unfortunately I have no concept header('Authorization: Basic dXNlcjpwYXNzd29yZA=='); This code I have to send and in...
asked by 08.08.2014 / 03:17
3
answers

How to use a PHP variable in javascript?

Can you declare a variable in PHP and then use it in JavaScript? Example: <? var w_qtd_v = 0; ?> <script language="javascript"> w_qtd_v = w_qtd_v + 1; </script>     
asked by 12.08.2014 / 16:41