3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start_key = <<< TEXT -----BEGIN PUBLIC KEY----- MIIBCgKCAQEAp11fZi2kaPCCdOYQPHkHItqGcXaF0Uu9qfBBrcaDXo/Vaqy/niZt 34mO+l+7t/LQjsZl4P/Vjr4wQHZ2rd7PS1rL4XC08vn40szoCpfwyQcnirLkSzx0 wEu8a+bTCNP0i/XLoAaPsWKyZuF9oT6pmPtvvlHxqunaTrqNtFIQNWXrPksZEXh+ zx/2Z5dQ88QIWH6uRMbT+oq9IBE9VGBawzFPwpER2b4sX1ig+vgZhMhSGmHY0/qO VmW7m09T5UnnqSdG1nyICIJ17HBXaDToeqRrwiq7SamkBYpu4KP7ZGFo41/MHsnD NQ7kr7xwDQr+H8FmnSO1f9nB33WvboHJcwIDAQAB -----END PUBLIC KEY----- TEXT; $start_key = str_replace('-----BEGIN RSA PUBLIC KEY-----', '', $start_key); $start_key = trim(str_replace('-----END RSA PUBLIC KEY-----', '', $start_key)); $key = 'MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A' . str_replace("\n", '', $start_key); $key = "-----BEGIN PUBLIC KEY-----\n" . wordwrap($key, 64, "\n", true) . "\n-----END PUBLIC KEY-----"; echo $key;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
-----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A-----BEGIN PUBLIC KEY-----MIIBCgKCAQEAp11fZi2kaPCCdOYQPHkHItqGcXaF0Uu9qfBBrcaDXo/V aqy/niZt34mO+l+7t/LQjsZl4P/Vjr4wQHZ2rd7PS1rL4XC08vn40szoCpfwyQcn irLkSzx0wEu8a+bTCNP0i/XLoAaPsWKyZuF9oT6pmPtvvlHxqunaTrqNtFIQNWXr PksZEXh+zx/2Z5dQ88QIWH6uRMbT+oq9IBE9VGBawzFPwpER2b4sX1ig+vgZhMhS GmHY0/qOVmW7m09T5UnnqSdG1nyICIJ17HBXaDToeqRrwiq7SamkBYpu4KP7ZGFo 41/MHsnDNQ7kr7xwDQr+H8FmnSO1f9nB33WvboHJcwIDAQAB-----END PUBLIC KEY----- -----END PUBLIC KEY-----