This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function limpa_array($array) { | |
| foreach($array as $arr) | |
| if($arr != '') | |
| $retorno[] = $arr; | |
| return $retorno; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| # first define colors to use | |
| $_colors = array( | |
| LIGHT_RED => "[1;31m", | |
| LIGHT_GREEN => "[1;32m", | |
| YELLOW => "[1;33m", | |
| LIGHT_BLUE => "[1;34m", | |
| MAGENTA => "[1;35m", | |
| LIGHT_CYAN => "[1;36m", | |
| WHITE => "[1;37m", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function plural($num) { | |
| if ($num != 1) | |
| return "s"; | |
| } | |
| function getRelativeTime($date) { | |
| $diff = time() - strtotime($date); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| # ---------------------------------------------------------------------- | |
| # DFN Thumbnailer | |
| # http://www.digifuzz.net | |
| # [email protected] | |
| # ---------------------------------------------------------------------- | |
| # Constants | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $bebeu_agua = "Não"; | |
| $ta_com_sede = "To"; | |
| if($bebeu_agua == "Não") { | |
| if($ta_com_sede == "To") { | |
| echo "Água, Água, Água mineral, Água mineral..."; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'mysql2' | |
| class Ecommerce | |
| attr_accessor :id, :name, :price, :bank_price, :con | |
| @@con = Mysql2::Client.new(:host => 'localhost', :username => 'root', :password => '1234', :database => 'ecommerce') | |
| def acessar_site(url) | |
| Nokogiri::HTML(open(url, :proxy_http_basic_authentication => ['http://192.168.254.200:8080', 'deyvin', 'fdcsistemas123'] )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| mysql_connect("localhost", "root", "1234"); | |
| $banco = 'ecommerce'; | |
| $db_selected = mysql_select_db($banco); | |
| $result = mysql_query('SHOW TABLES'); | |
| while($row = mysql_fetch_assoc($result)) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('TOTALAPLICADO', 1000); | |
| define('PERC_RENDIMENTO', 15); | |
| define('DIAS', 31); | |
| $total_por_dia = ((TOTALAPLICADO * PERC_RENDIMENTO) / 100) / DIAS; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $valor_desejado = 500; | |
| $percentual = 20; | |
| echo ($valor_desejado * 100) / (100 − $percentual); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $db = ibase_connect ('localhost:/usr/db/db.gdb', 'SYSDBA', 'masterkey'); | |
| $tr = ibase_trans( IBASE_DEFAULT, $tr ); #abre a transação do firebird | |
| $insert = "INSERT INTO CLIENTES (ID, NOME) VALUES (1, 'JOSE')"; | |
| ibase_query($tr, $insert); | |
| $insert = "INSERT INTO CLIENTES (ID, NOME) VALUES (1, 'JOSE')"; |