3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function insert_random_chars($str, $alphabet = "ABCDEFGHIJKLMNOPGRSTUVWXYZ") { // An array to hold the result $result = array(); // The highest character index in the string $max = strlen($alphabet) - 1; // Loop the characters in the input string foreach (str_split($str, 1) as $char) { // Add the current character and a random character to the output array array_push($result, $char, $alphabet[mt_rand(0, $max)]); } // Join the output array together return implode('', $result); } echo insert_random_chars("0123456789");
Output for 7.1.0
0P1R2V3G4Y5J6C7F8Y9R
Output for 7.0.14
0N1F2M3G4P5G6H7X8K9O
Output for 7.0.10
0B1I2S3M4O5V6A7E8V9R
Output for 7.0.9
0D1U2B3H4K5T6F7J8N9R
Output for 7.0.8
0T1B2I3F4O5W6E7T8I9Z
Output for 7.0.7
0H1U2M3W4F5T6U7J8F9Y
Output for 7.0.6
0T1T2W3C4R5T6Z7H8G9O
Output for 7.0.5
0G1K2G3P4H5E6N7M8E9N
Output for 7.0.4
0G1S2E3X4A5R6Y7N8P9H
Output for 7.0.3
0L1X2F3B4Z5L6P7X8W9G
Output for 7.0.2
0B1K2N3I4T5K6O7U8K9X
Output for 7.0.1
0K1K2H3X4G5C6E7O8N9J
Output for 7.0.0
0F1G2X3W4K5Z6Z7B8O9F
Output for hhvm-3.12.0
0G1V2F3C4P5W6T7G8X9Y
Output for hhvm-3.10.0
0U1V2W3Z4S5F6E7I8T9D
Output for 5.6.28
0W1G2J3H4Y5D6E7T8S9C
Output for 5.6.25
0M1I2L3G4W5J6E7R8C9I
Output for 5.6.24
0B1U2J3Z4G5G6F7K8V9A
Output for 5.6.23
0V1E2K3M4Y5K6E7W8B9G
Output for 5.6.22
0B1S2B3V4C5U6A7G8Y9A
Output for 5.6.21
0Y1U2I3J4R5L6L7B8F9L
Output for 5.6.20
0K1U2Y3V4D5C6L7L8P9C
Output for 5.6.19
0D1S2G3D4V5M6L7O8P9V
Output for 5.6.18
0T1Z2A3C4K5E6O7H8W9E
Output for 5.6.17
0G1N2L3W4L5J6C7X8J9J
Output for 5.6.16
0N1T2D3A4X5F6T7Z8Z9N
Output for 5.6.15
0T1L2X3M4U5S6I7W8Z9D
Output for 5.6.14
0S1S2O3G4A5E6F7G8P9K
Output for 5.6.13
0K1C2P3S4H5Y6F7P8T9U
Output for 5.6.12
0G1T2Z3R4G5G6Y7O8R9Z
Output for 5.6.11
0R1K2O3R4D5V6G7G8F9X
Output for 5.6.10
0F1X2G3W4T5D6O7E8L9T
Output for 5.6.9
0W1O2G3S4A5I6Z7J8F9C
Output for 5.6.8
0Y1B2W3L4U5Y6H7F8D9D
Output for 5.6.7
0I1R2N3U4U5S6K7R8C9B
Output for 5.6.6
0Z1W2U3G4B5V6G7K8O9D
Output for 5.6.5
0S1O2X3M4D5W6A7X8E9J
Output for 5.6.4
0G1N2N3D4G5H6O7N8N9T
Output for 5.6.3
0I1S2R3F4B5V6D7O8V9W
Output for 5.6.2
0E1I2S3A4C5A6P7P8E9K
Output for 5.6.1
0C1G2H3M4S5Z6C7V8H9O
Output for 5.6.0
0M1J2A3X4K5A6A7C8C9K
Output for 5.5.38
0D1Z2D3G4V5R6G7B8V9P
Output for 5.5.37
0N1Y2B3D4K5N6K7I8P9G
Output for 5.5.36
0V1Y2U3C4K5U6S7M8W9J
Output for 5.5.35
0B1X2E3J4V5T6Z7S8E9F
Output for 5.5.34
0K1F2G3F4H5G6H7C8S9N
Output for 5.5.33
0G1I2L3P4R5P6O7T8E9I
Output for 5.5.32
0J1I2K3G4H5D6S7H8C9A
Output for 5.5.31
0G1J2C3Y4E5D6B7I8C9G
Output for 5.5.30
0P1U2K3S4B5B6H7C8F9F
Output for 5.5.29
0S1H2Y3W4U5W6Y7N8F9K
Output for 5.5.28
0A1R2A3U4S5K6P7G8W9C
Output for 5.5.27
0S1Z2X3K4B5F6U7L8J9T
Output for 5.5.26
0G1C2N3M4V5B6O7T8B9W
Output for 5.5.25
0H1K2Y3W4L5E6U7K8T9I
Output for 5.5.24
0S1N2H3X4K5G6C7D8M9D
Output for 5.5.23
0V1A2M3T4G5W6G7E8Y9R
Output for 5.5.22
0D1R2P3S4V5I6C7T8I9P
Output for 5.5.21
0F1F2P3O4N5H6V7N8T9F
Output for 5.5.20
0B1B2H3M4A5G6X7K8O9I
Output for 5.5.19
0G1S2F3Z4I5X6T7U8Z9A
Output for 5.5.18
0N1X2G3G4H5V6P7V8I9T
Output for 5.5.16
0F1O2W3G4P5Y6H7G8X9A
Output for 5.5.15
0M1E2W3S4O5N6U7F8A9S
Output for 5.5.14
0V1G2L3Z4Y5P6N7O8O9T
Output for 5.5.13
0D1H2F3Z4D5O6G7F8P9G
Output for 5.5.12
0M1P2J3D4F5S6O7W8Y9T
Output for 5.5.11
0O1V2X3N4N5E6W7F8L9U
Output for 5.5.10
0T1J2E3A4P5M6G7I8P9P
Output for 5.5.9
0R1R2G3M4F5U6J7E8F9F
Output for 5.5.8
0U1W2P3P4Y5G6Z7Z8V9H
Output for 5.5.7
0E1U2I3K4I5M6B7G8Y9F
Output for 5.5.6
0C1F2E3C4A5B6X7K8K9Y
Output for 5.5.5
0S1C2D3I4H5C6B7L8T9I
Output for 5.5.4
0H1K2N3W4F5J6B7L8R9L
Output for 5.5.3
0V1G2E3T4C5X6O7C8V9R
Output for 5.5.2
0Z1C2W3V4G5F6J7B8C9H
Output for 5.5.1
0A1U2U3V4F5P6N7Z8P9Z
Output for 5.5.0
0C1C2R3H4I5S6C7A8Y9Z
Output for 5.4.45
0Y1P2H3R4O5D6E7R8W9D
Output for 5.4.44
0A1F2C3N4D5E6A7P8N9T
Output for 5.4.43
0O1L2S3R4G5F6P7E8O9B
Output for 5.4.42
0X1U2I3Z4P5M6Z7W8S9W
Output for 5.4.41
0D1C2O3N4X5H6L7M8F9W
Output for 5.4.40
0P1T2W3Z4G5F6R7G8G9X
Output for 5.4.39
0S1X2G3T4S5R6L7H8W9X
Output for 5.4.38
0B1K2C3I4B5C6C7T8G9D
Output for 5.4.37
0R1G2C3L4G5H6B7B8P9F
Output for 5.4.36
0D1I2I3M4E5J6E7K8J9M
Output for 5.4.35
0H1G2L3S4M5Z6H7T8S9X
Output for 5.4.34
0O1I2H3G4P5O6I7M8H9G
Output for 5.4.32
0D1G2Y3S4A5L6R7K8T9F
Output for 5.4.31
0K1Z2W3D4Y5K6G7B8O9U
Output for 5.4.30
0P1S2V3W4J5V6Z7X8D9B
Output for 5.4.29
0A1C2G3U4M5U6Y7H8I9F
Output for 5.4.28
0C1F2U3B4R5G6P7O8R9C
Output for 5.4.27
0D1K2G3E4S5Y6F7J8Y9B
Output for 5.4.26
0N1R2Z3W4L5F6K7T8L9I
Output for 5.4.25
0M1M2V3P4Y5O6S7I8G9A
Output for 5.4.24
0M1L2O3U4B5O6E7M8C9A
Output for 5.4.23
0U1K2V3Y4G5N6X7W8R9P
Output for 5.4.22
0Z1P2B3Z4L5W6N7P8P9P
Output for 5.4.21
0W1S2F3V4O5G6L7X8D9S
Output for 5.4.20
0A1X2Z3B4H5K6A7I8Y9B
Output for 5.4.19
0E1O2G3V4A5G6A7G8U9V
Output for 5.4.18
0J1G2R3I4A5M6D7V8N9Y
Output for 5.4.17
0C1K2P3X4J5E6T7S8M9D
Output for 5.4.16
0L1U2B3W4I5A6B7S8W9R
Output for 5.4.15
0Y1A2O3Y4Z5Y6V7L8S9O
Output for 5.4.14
0S1W2X3X4B5R6U7B8H9R
Output for 5.4.13
0T1Y2X3O4H5R6H7A8G9N
Output for 5.4.12
0M1V2U3G4D5N6J7E8R9E
Output for 5.4.11
0Y1G2Y3C4G5U6A7G8D9W
Output for 5.4.10
0I1D2G3T4G5V6P7L8H9G
Output for 5.4.9
0M1S2M3S4I5H6W7A8H9G
Output for 5.4.8
0Y1D2P3B4Z5F6V7G8M9G
Output for 5.4.7
0D1M2Z3F4N5P6T7L8J9P
Output for 5.4.6
0G1J2Z3R4A5O6C7Y8U9I
Output for 5.4.5
0K1G2U3H4T5V6R7P8N9E
Output for 5.4.4
0X1P2F3T4Y5P6O7I8W9N
Output for 5.4.3
0G1L2M3C4U5T6L7N8D9Y
Output for 5.4.2
0A1T2L3S4R5V6G7P8A9S
Output for 5.4.1
0X1W2W3S4I5J6L7S8F9B
Output for 5.4.0
0V1G2S3B4K5O6J7M8C9U
Output for 5.3.29
0E1D2P3R4I5C6F7V8X9P
Output for 5.3.28
0H1I2G3G4D5N6U7E8V9X
Output for 5.3.27
0G1Y2V3S4A5Z6X7N8C9P
Output for 5.3.26
0K1Z2V3A4Z5J6K7Z8U9M
Output for 5.3.25
0U1F2U3L4G5X6D7I8U9E
Output for 5.3.24
0O1C2D3C4R5V6O7T8E9M
Output for 5.3.23
0U1P2A3N4D5N6P7Z8V9L
Output for 5.3.22
0H1M2F3S4W5V6X7U8L9L
Output for 5.3.21
0F1S2S3S4Y5W6S7L8Z9L
Output for 5.3.20
0A1R2S3H4K5E6Z7U8B9R
Output for 5.3.19
0I1C2V3N4T5T6F7A8C9X
Output for 5.3.18
0G1F2L3N4C5J6S7H8B9I
Output for 5.3.17
0Y1B2K3O4U5V6S7K8U9T
Output for 5.3.16
0F1T2I3E4Y5Y6L7G8J9Z
Output for 5.3.15
0D1A2R3W4W5N6Z7I8X9H
Output for 5.3.14
0U1S2Z3L4G5E6P7T8J9G
Output for 5.3.13
0S1U2S3D4V5M6M7W8P9N
Output for 5.3.12
0U1D2G3G4J5J6X7F8K9C
Output for 5.3.11
0C1N2A3J4N5I6Y7K8D9G
Output for 5.3.10
0L1G2P3L4L5G6C7W8A9R
Output for 5.3.9
0W1I2G3G4K5G6M7G8R9B
Output for 5.3.8
0W1Z2F3L4P5Y6H7C8D9J
Output for 5.3.7
0L1X2V3E4I5E6P7Y8D9M
Output for 5.3.6
0O1K2Z3T4V5S6R7V8Y9X
Output for 5.3.5
0S1I2S3J4E5K6G7T8S9Z
Output for 5.3.4
0T1V2U3P4T5J6P7L8D9N
Output for 5.3.3
0K1E2U3L4G5U6O7P8E9M
Output for 5.3.2
0J1H2E3C4A5W6L7G8U9Z
Output for 5.3.1
0T1M2R3O4G5Y6X7N8A9F
Output for 5.3.0
0M1E2D3D4X5S6G7A8F9G
Output for 5.2.17
0J1F2S3Z4S5G6Z7K8Z9P
Output for 5.2.16
0V1I2L3A4J5J6K7X8N9K
Output for 5.2.15
0S1I2A3K4U5M6G7W8V9F
Output for 5.2.14
0J1M2W3G4U5V6C7K8E9C
Output for 5.2.13
0J1S2O3D4R5B6H7Y8P9K
Output for 5.2.12
0F1P2D3R4R5J6Z7T8E9M
Output for 5.2.11
0Z1R2P3I4F5I6I7H8P9G
Output for 5.2.10
0D1N2U3T4F5W6G7L8E9F
Output for 5.2.9
0V1R2Z3G4H5A6J7X8L9R
Output for 5.2.8
0E1V2F3G4K5V6I7R8L9W
Output for 5.2.7
0U1O2Z3S4M5E6P7S8S9A
Output for 5.2.6
0L1S2O3R4E5D6T7G8X9K
Output for 5.2.5
0X1R2D3R4J5G6U7Y8W9E
Output for 5.2.4
0P1X2K3U4G5F6U7V8G9X
Output for 5.2.3
0I1P2Z3Y4F5K6L7G8E9X
Output for 5.2.2
0A1W2T3A4X5N6K7G8F9Y
Output for 5.2.1
0D1Y2J3G4K5G6F7M8T9G
Output for 5.2.0
0Z1D2W3J4T5B6T7B8X9S
Output for 5.1.6
0P1G2F3E4M5B6J7R8W9A
Output for 5.1.5
0R1T2D3K4K5D6A7R8T9L
Output for 5.1.4
0B1I2V3B4I5O6V7K8V9G
Output for 5.1.3
0C1W2C3G4K5X6S7W8L9R
Output for 5.1.2
0P1G2R3V4B5M6G7U8G9O
Output for 5.1.1
0S1D2D3Z4B5G6G7I8E9R
Output for 5.1.0
0X1R2E3K4V5X6R7P8Z9L
Output for 5.0.5
0T1N2N3V4N5R6J7S8A9K
Output for 5.0.4
0F1C2C3J4J5Z6B7N8I9R
Output for 5.0.3
0Y1I2P3Y4G5B6P7M8P9G
Output for 5.0.2
0G1Z2S3V4V5D6I7D8G9O
Output for 5.0.1
0U1V2B3J4B5V6E7P8J9L
Output for 5.0.0
0M1Z2E3K4O5Y6R7N8O9J
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/oKvZ0 on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/oKvZ0 on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/oKvZ0 on line 12