Call php class method from string with parameter

后端 未结 3 600
猫巷女王i
猫巷女王i 2021-01-05 09:58

I am having trouble calling a class method from a string in PHP. Here\'s a simple example. Once I get this working I\'ll be using a variable as the method n

3条回答
  •  滥情空心
    2021-01-05 10:40

    Try this:

    $tags_array = call_user_func(array($yourClassObj, 'get_images_for_tag'), $row["id"]);
    

提交回复
热议问题