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 | |
/* | |
This is a sample PHP script of how you would ideally integrate with iPay Payments Gateway and also handling the | |
callback from iPay and doing the IPN check | |
---------------------------------------------------------------------------------------------------- | |
************(A.) INTEGRATING WITH iPAY *********************************************** | |
---------------------------------------------------------------------------------------------------- | |
*/ | |
//Data needed by iPay a fair share of it obtained from the user from a form e.g email, number etc... |
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 | |
$amount_paid = 65.50; | |
$totaldays = date('t',strtotime('15-02-2019')); | |
$amount_paid_per_day = $amount_paid/$totaldays; | |
$start_date = date('d',strtotime('15-02-2019')); | |
$today_date = date('d'); | |
$total_refund_day = $totaldays -($today_date - $start_date); | |
$total_refund_amount = number_format($amount_paid_per_day*$total_refund_day,2,'.',''); | |
echo $totaldays.'--total days in month specified--'.$amount_paid.' ----- '. $total_refund_day .' ---- '.$total_refund_amount; |
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 | |
echo phpinfo(); | |
?> |
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 | |
$TOKEN="58b5c79b9ef28083cbf44e198312406f051e393c7206bd90c2c6da"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,"https://meeiot.org/put/$TOKEN/mydata"); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
$payload = json_encode( array( "jsonkey"=> "json value" ) ); | |
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload ); | |
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); | |
$result = curl_exec($ch); |
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 | |
$TOKEN="58b5c79b9ef28083cbf44e198312406f051e393c7206bd90c2c6da"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,"https://meeiot.org/put/$TOKEN/mydata"); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
$payload = json_encode( array( "jsonkey"=> "json value" ) ); | |
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload ); | |
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); | |
$result = curl_exec($ch); |
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 | |
echo "hello"; | |
?> |
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 | |
?> |
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 | |
/* | |
NOTES: If $newa is not pre-filled, the function will fail | |
because the keys will be added out of numerical order, and also, we can't | |
use ksort here because the test times out for large input arrays if we | |
do sorts or shifts of any kind. | |
i.e. $newa[0] might not be in the first spot of the array for instance. | |
Pre-filling the $newa array makes sure that the keys are 0-($n-1) in order. |
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 request(){ | |
echo "<h1>requested</h1>"; | |
} | |
request() | |
?> | |
<html id="html"> | |
<button id="btn_click" onclick="request1()">click</button> | |
</html> | |
<script type="text/javascript"> |
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 | |
namespace helper; | |
class ArrayHelper | |
{ | |
public static function each() | |
{ | |
$args = func_get_args(); | |
$callback = array_shift($args); | |