I have the following piece of PHP code posted in a topic:
function wdates($start = 0, $amount = 10, $format = 'Y', $interval = 'Y', $decrease = true)
{
// Determining where we should start the dates (In years)
$start = ((is_numeric($start)) ? $start : 0);
// Accomidating the AMOUNT returned accordignly to the START
$amount += $start;
// Creating an array of years {$amount} times
for($i = $start; $i <= $amount; ++$i)
{
// Checking the interval to increase/decrease by
$int = (($interval == 'D') ? 'day' : (($interval == 'M') ? 'month' : 'year'));
// Checking if we are decreasing or increasing
$loop = (($decrease == true) ? '-' : '+');
// Creating the appropriate time stampe
$tmsp = strtotime($loop . $i . ' ' . $int);
// Building the date array
$date_arr[] = date($format, $tmsp);
}
// Returning the date array
return $date_arr;
}
- function wdates($start = 0, $amount = 10, $format = 'Y', $interval = 'Y', $decrease = true)
- {
- // Determining where we should start the dates (In years)
- $start = ((is_numeric($start)) ? $start : 0);
-
- // Accomidating the AMOUNT returned accordignly to the START
- $amount += $start;
-
- // Creating an array of years {$amount} times
- for($i = $start; $i <= $amount; ++$i)
- {
- // Checking the interval to increase/decrease by
- $int = (($interval == 'D') ? 'day' : (($interval == 'M') ? 'month' : 'year'));
-
- // Checking if we are decreasing or increasing
- $loop = (($decrease == true) ? '-' : '+');
-
- // Creating the appropriate time stampe
- $tmsp = strtotime($loop . $i . ' ' . $int);
-
- // Building the date array
- $date_arr[] = date($format, $tmsp);
- }
-
- // Returning the date array
- return $date_arr;
- }
The problem is, all of the plus signs (+) are stripped out of the code.
The problem is not only in the code, but with the entire post itself. If I happen to have a plus sign in the post (Like C++ or something), all of them are stripped out.
Look at
this post for example... at the bottom when I'm talking about the syntax tag, there is the code example that I pasted above, those plus signs that you see here are just empty spaces on my site... how do I fix that?
Thanks in advance!
"Bring forth therefore fruits meet for repentance:" Matthew 3:8