Jump to content

str_repeat


spfoonnewb

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.