ssss - 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 ssss.php
- <!-- form_helper.php -->
- <!DOCTYPE html>
- <html>
- <body>
- <?php
- class FormHelper {
- public static function extractTitlesForWBForm($input_string) {
- $titles = explode('|', $input_string);
- array_splice($titles, 0, 3);
- $title_variables = [
- 'NAME' => 'Name',
- 'MAIL' => 'Email',
- 'PHON' => 'Phone',
- 'COMP' => 'Company',
- 'ADRE' => 'Address',
- 'NOTE' => 'Note',
- 'AVTNOTE' => 'Avatar Evaluation',
- 'OBJ' => 'Object',
- 'COM' => 'Comment'
- ];
- $iframe_title = '';
- foreach ($titles as $title) {
- if (isset($title_variables[$title])) {
- $iframe_title .= $title_variables[$title] . ', ';
- }
- }
- $iframe_title = rtrim($iframe_title, ', ');
- return $iframe_title;
- }
- }
- $consign = 'WBform:__Qb|engine_88_8989899aaa|S5|NAME*|MAIL*|PHON|COMP|ADRE|NOTE|AVTNOTE|OBJ|COM';
- $iframe_title = FormHelper::extractTitlesForWBForm($consign);
- echo $iframe_title;
- ?>
- </body>
- </html>