RSS Feed/News Optimization foreach code

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
25,429
Points
823

Reputation:

I been working on some addons and looking for optimization some foreach any suggest about this code?

Want to same users stories to same array.

PHP:

Code:
        $addedStoryUsers = [];

$storyUsers = [];
        $var_limit = 1;
        foreach($stories AS $story){
            if(in_array($story->User->user_id, $addedStoryUsers))continue;
            if($var_limit <= $limit){
                $storyUsers[$story->User->user_id] = [
                    'user' => $story->User...

Read more

Continue reading...
 
Status
Not open for further replies.
Top