Questions tagged as 'php'

3
answers

Enable and disable a form edit button - with PHP

I have the following situation: I have a page (ex: EDIT.PHP) that will be where the information that was previously registered by a form (User Registration Form) will be edited. The question is, at the end of this EDIT.PHP page, will it have a s...
asked by 17.09.2015 / 21:34
2
answers

How to remove R $ from NumberFormatter?

I'm having the following problem. Follow my code: $valores = '530222077.99'; $moeda = new NumberFormatter('pt_BR', NumberFormatter::CURRENCY); $valores = $moeda->formatCurrency($valores, 'BRL'); echo $valores; The following code retur...
asked by 25.02.2016 / 17:53
2
answers

How can I check if a table is empty?

I want to check if a MySQL table is empty (no record) with PHP, how can I do that? What kind of consultation do I make to make sure of this?     
asked by 20.10.2016 / 05:42
2
answers

Replace contents of one table with another?

My case is as follows: I have two tables TAB1 and TAB2 ; the two tables have the same structure: (id, name, nickname). I would like to replace the contents of TAB1 with TAB2 . Everything in TAB2 must be del...
asked by 02.11.2016 / 10:44
1
answer

Return Json PHP to Ajax

Next I have a variable in client.php that prints: [{"CODIGO_CLIENTE":3,"CGC":"78.079.128\/0001-80","RAZAO":"Cliente 2","FANTASIA":"Cliente 2","TELEFONE1":"+99(99)9999-9999"}, {"CODIGO_CLIENTE":2,"CGC":"14.617.787\/0001-40","RAZAO":"Cl...
asked by 26.10.2016 / 13:25
1
answer

Exclude repeated values from a variable

I'll just give you a simpler example so I do not have to post the whole code, I do not know if that's possible. $exemplo = "exemplo exemplo" echo $exemplo; When displaying this variable with echo it returns "example example", would it have...
asked by 26.04.2016 / 20:15
3
answers

Compare the same variable in PHP [closed]

I have the same variable where it can take two values <?php if($adm1){ $email = '[email protected]'; }elseif( $adm1){ $email = '[email protected]'; } How to compare the two variables as follows, if anything that comes differen...
asked by 06.04.2016 / 16:20
3
answers

Insert data into a multidimensional array

I have a multidimensional array [0] => Array ( [per] => Array ( [per_dep] => Array ( [0] => 1115921...
asked by 14.04.2016 / 21:11
2
answers

How do I get the strings that are enclosed in brackets?

Good morning. Thank you very much in advance.. How can I get the content inside the brackets? lang[en-US].php lang[pt-BR].php In fact it is a list of files that are inside a folder: $atual = $ap . $dir . '/' . $file; if(is_file($atual)) {...
asked by 02.04.2016 / 15:24
1
answer

How to show string up to a certain occurrence?

I want to display a string up to occurrence X, I could only do it this way: echo substr($conteudo, 0, strpos($conteudo, 'quebra-de-linha')); Is there a native resource in PHP that can do this? So I do not need to chain substr and strpos as...
asked by 11.11.2016 / 18:25