Примечание. В C: \ xampp \ htdocs \ Space \ Find \ index.php в строке 21 встречается некорректно сформированное числовое значение.

<?php 

    $offset = 0;

    if ( isset($_POST['text']) && isset($_POST['searchfor']) && isset($_POST['replacewith']) ) {
        $text = $_POST['text'];
        $searchfor = $_POST['searchfor'];
        $replacewith = $_POST['replacewith'];

        $search_length = strlen($searchfor);

        if (!empty($text) && !empty($searchfor) && !empty($replacewith)) {

            while ($stringpos = strpos($text, $searchfor, $offset)) {
                echo $stringpos.'<br/>';
                echo $offset = $stringpos + $search_length.'<br/>';
            }

        }
        else{
            echo "There Mustn't be any Void Space in the Field.";
        }
    }

?>

<form action="index.php" method="POST">
    <textarea name="text" placeholder="Enter the MSG here" rows="6" cols="30"></textarea><br/><br/>
    <input type="text" name="searchfor" class="search" placeholder="Search for"><br/><br/>
    <input type="text" name="replacewith" class="replace" placeholder="Replace with"><br/><br/>
    <input type="submit" value="Find and Replace">
</form>

Вот где у меня возникают проблемы при получении сообщения об ошибке при поиске.

while ($stringpos = strpos($text, $searchfor, $offset)) 

Примечание. В C: \ xampp \ htdocs \ Space \ Find \ index.php в строке 21 встречается некорректно сформированное числовое значение.

Кто-нибудь, пожалуйста, помогите мне здесь, любая помощь будет оценена.

Ответы на вопрос(1)

Ваш ответ на вопрос