14 lines
292 B
PHP
14 lines
292 B
PHP
<?php
|
|
|
|
$valid_input = $_POST['input_text'];
|
|
|
|
if (isset($_POST['input_char'])){
|
|
$locations = array();
|
|
for ($i=0; $i < strlen($valid_input); $i++) {
|
|
if ($_POST['input_char'] == $valid_input[i]){
|
|
array_push($locations, $i);
|
|
}
|
|
}
|
|
|
|
echo $locations[0];
|
|
} |