arrays - PHP: Can't use function return value in context - error -
arrays - PHP: Can't use function return value in context - error -
i'm not sure i'm doing wrong, , did check other questions, , kind of inferred returning (something called "empty") supports variables, although didn't alter anything.
i getting unusual error in code when run it, , can't create head or tails of it.
fatal error: can't utilize function homecoming value in write context in /home/shortcu1/public_html/projects/friendcodes/newuser.php on line 103
this main function that's beingness called. (in file called newuser.php)
function isbumping($forumid, $username, $premium){ if($premium == 'true'){ $file = file_get_contents('plist.txt'); // file i'm testing on echo 'running code premium<br>'; } else { $file = file_get_contents('list.txt'); } $forumid = $forumid.':'.$username; $posts = explode(' ', $file); $posts ($info, $bump) = array_filter($posts, function($item) utilize ($forumid, $posts){ // check matching forum id if(strpos($item, $forumid) !== true){ $pos = strpos($item, ':day-'); $pos = $pos + 5; $day = (int) substr($item, $pos, 1); // converts stored date numerical value. remember 1 = monday, 7 = sunday $today = date('n'); $bump = false; if(($day+3) % 7 > $today){ // old plenty re-bump homecoming array ($item, $bump); } else { // recent re-bump $bump = true; homecoming array ($item, $bump); } } }); print_r($posts[1]); echo '<br>'; print_r($posts[2]); }
it beingness run through file test.php:
include('newuser.php'); isbumping(1, 'spitfire', 'true')
the file called plist.txt follows:
1:spitfire:day-4:8jx-ukr8:8jx-ukr8:spirit:90 1:spitfire:day-4:8jx-ukr8:8jx-ukr8:spirit:90 1:spitfire:day-4:8jx-ukr8:8jx-ukr8:spirit:90 1:spitfire:day-4:8jx-ukr8:8jx-ukr8:spirit:90
try changing
$posts ($info, $bump) =
to
$posts =
php arrays return
Comments
Post a Comment