php for loop freezes while looping -
When I tried the variable while raising the loop, my screen was frozen and I got the error:
Fatal error: maximum execution time of 30 seconds /home/diligenceh/domains/diligencehelps.com/public_html/upload_lesson.php line exceeded 16
Loop:
$ lesson_count = preg_replace ('# [^ 0-9] #', '', $ _POST ['description_count']); ($ I = 1; $ i & lt; = $ lesson_count; $ i ++) for {$ image_url_ + $ i = $ _POST ['image_url _' + $ i]; Echo $ image_url_ + $ i; } I think your code should be something like this:
$ _ POST ['description_count'] = preg_replace ('# [^ 0-9] #', '', $ _POST ['description_count'], -1, $ deducted); For ($ i = 1; $ i & lt; = $ lesson_count; $ i ++) {echo $ _POST ['image_url _'. $ I]; }
Pay atention to the following:
1.- preg_replace () has the number of replacements in 4 parameters.
2. - Return the original string with the function preg_replace changes. Read the manual here:
3.- I do not know what you are trying to do here:
$ image_url_ + $ i = $ _POST ['image_url_ '+ $ I];
You add a string using dot (.) Instead of plus sign (+).
Comments
Post a Comment