sjcoder07
March 11th, 2008, 02:20 AM
Hello everyone:
I am doing an exercise using substr_count function. I received a warning message and I couldn't figure out what caused the error.
Please help me troubleshooting the problem and tell me what I did wrong. Thanks!
<?php
$text = "This is a test";
echo substr_count($text, 'is', 3) . "<br />"; //line8
echo substr_count($text, 'is', 3, 3) . "<br />"; //line 10
?>
Error message: Warning: Wrong parameter count for substr_count() line 8 and line 10.
I am doing an exercise using substr_count function. I received a warning message and I couldn't figure out what caused the error.
Please help me troubleshooting the problem and tell me what I did wrong. Thanks!
<?php
$text = "This is a test";
echo substr_count($text, 'is', 3) . "<br />"; //line8
echo substr_count($text, 'is', 3, 3) . "<br />"; //line 10
?>
Error message: Warning: Wrong parameter count for substr_count() line 8 and line 10.