php invalid argument in foreach supplied -


i cannot life of me figure out why error being thrown...i supplying valid array , basic loop

php

class stats {      private $resirictedchars = array('@', '(', ')', '"', '<', '>', ',', '?', ':', ';', '[', ']', '{', '}');      function __construct() {}      public function generatestats ($text) {          foreach ($this->restrictedchars $char) {              $text = str_replace($char, '', strtolower($text));          }          echo $text;      } }  $run = stats::generatestats('hello.'); 

error

warning: invalid argument supplied foreach() 

typo in variable names, $resirictedchars v/s $restrictedchars.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -