I am fairly new to PHP (less than a year), and to improve my development environment, I recently started using NetBeans IDE.
A warning keeps popping up everywhere stating that "Variable might not have been initialized".
I'll give an example of a variable that results in this hint/warning:
$start = $per_page * $page;
My question is: How can I initialize a PHP variable? Also, how important is it that a variable is initialized in PHP?
I appreciate any advice you can provide.
Note: I tried to place the following code above my variable, to no avail.
$start = '';
$per_pageor$pagemight not have been initialized. You're initializing$startto the product of these variables, but were these two variables initialized?$per_pageand$page?varwhen using JavaScript; you've not got a mix of PHP and JS in the document?$start = '';would initialise the variable... (unless it's in class scope but then you'd get a syntax error).$per_pageor$page. I will try that. Is my syntax correct for initialization? e.g.$per_page = '';?