spfoonnewb Posted April 9, 2007 Share Posted April 9, 2007 Hi, I am trying to use str_repeat in an if statement.. is there any way to get this to work? Currently returns: Fatal error: Function name must be a string. if (10 + 10 (str_repeat("+ 10", 2) == $default)) { //Do something } Literally it would look like (But I don't want it limited like that): if (10 + 10 + 10 + 10 == $default)) { //Do something } Link to comment https://forums.phpfreaks.com/topic/46213-str_repeat/ Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 erm... where are the 10's coming from ? an array ? if so use array_sum Link to comment https://forums.phpfreaks.com/topic/46213-str_repeat/#findComment-224694 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.