crashmaster Posted April 27, 2009 Share Posted April 27, 2009 Hi, got an error "Fatal error: Function name must be a string in C:\localhost\www\DNBSTEP\pages\lol.php on line 6" lol.php: $video_types = array('videos','tutorials'); $video_url_format = array('videos'=>'video','tutorials'=>'tutorial); $type = 'videos'; echo $video_url_format($type); //this is line 6 How to understand that ?? Thx for any help... Quote Link to comment https://forums.phpfreaks.com/topic/155765-solved-dont-understand-very-simple/ Share on other sites More sharing options...
premiso Posted April 27, 2009 Share Posted April 27, 2009 echo $video_url_format[$type]; //this is line 6 PHP uses [ and ] for arrays not ( ) as those signify a function, like the error explains. Quote Link to comment https://forums.phpfreaks.com/topic/155765-solved-dont-understand-very-simple/#findComment-819934 Share on other sites More sharing options...
mrMarcus Posted April 27, 2009 Share Posted April 27, 2009 what are you trying to do? $video_url_format is an array in your case .. how you're trying to use it is not going to work at all. Quote Link to comment https://forums.phpfreaks.com/topic/155765-solved-dont-understand-very-simple/#findComment-819935 Share on other sites More sharing options...
crashmaster Posted April 27, 2009 Author Share Posted April 27, 2009 Hey, thanks a lot - such an amateur mistake )))) Quote Link to comment https://forums.phpfreaks.com/topic/155765-solved-dont-understand-very-simple/#findComment-819936 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.