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 | |
$arrVacio=array(); | |
$varDeclarada; | |
$arrValores=array( | |
'vacio ("")'=>'', | |
'en blanco (" ")'=>' ', | |
'NULL'=>NULL, | |
'TRUE'=>TRUE, | |
'FALSE'=>FALSE, | |
'0 (como cadena)'=>'0', |
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 greeting($name, $age) { | |
return "<h1>Hello " . $name . " you are " . $age . " years old today. Happy Birthday!!</h1>"; | |
} | |
echo greeting('Billy', '146'); | |
?> |
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 | |
$n = '2.2737367544323E-13'; | |
$n = preg_replace('/[^0-9.]/', '', $n); | |
echo number_format($n, 2, '.', ''); | |
?> |
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 | |
$str = "parital Under production"; | |
$result = explode(' ', $str, 2); | |
print_r($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
<html> | |
<form> | |
<input type="text" name="currency" method="post"> | |
<select name='cur1'> | |
<option value="can">Candian Dollor(AUD)</option> | |
<option value="USD" selected>US Dollar(USD)</option> | |
<option value="inr" selected>indian rupee</option> | |
</select> | |
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 | |
gfhgh | |
?> |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<div> Open Work Example </div> | |
<?php | |
$workid = "S-95"; | |
/* In a production scenario, this id would be retrieved dynamically maybe from a rest service which takes in a few input search | |
parameters and returns the id, like get me the id of the loan application of ApplicantName = xxx | |
*/ | |
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 | |
/** | |
* | |
* Consulta con PDO mediante query | |
* | |
* Notas: | |
* - Los require indicados solo sirven para este ejemplo | |
* - La consulta SQL y el resultado son sólo para mostrar un ejemplo , | |
* cada uno debe adaptarla a sus necesidades |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<div> Open Work Example </div> | |
<?php | |
$workid = "S-95"; | |
/* In a production scenario, this id would be retrieved dynamically maybe from a rest service which takes in a few input search | |
parameters and returns the id, like get me the id of the loan application of ApplicantName = xxx | |
*/ | |
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 isDecimal($value) { | |
return ((float) $value !== floor($value)); | |
} | |
$test_vars = array("10","1.01", "1.0101"); | |
foreach ($test_vars as $var) { | |
echo $var . "is_float: " . is_float($var) . " | isDecimal:" . isDecimal($var) . "<br>"; | |
} |