test - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of test.php
- <?php
- $data = [
- "a" => true,
- "b" => false
- ];
- $data['signature'] = generateSignature($data); // return fa0ee1e2acf7f898635ec417491381c0a4f9d35c
- //send $data like json ...
- function generateSignature(array $data) {
- $privateKey = 'yourprivatekey';
- ksort($data);
- $implode = multiImplode( ':', $data);
- return sha1($privateKey . md5($implode));
- }
- function multiImplode($glue, $array): string
- {
- $finArray = [];
- foreach ($array as $val) {
- $finArray[] = is_array($val) ? self::multiImplode($glue, $val) : $val;
- }
- return implode($glue, $finArray);
- }
File Description
- test
- PHP Code
- 08 Sep-2022
- 604 Bytes
You can Share it:
Latest PHP Pastes