Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6039803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:25:22+00:00 2026-05-23T06:25:22+00:00

im trying to make facebook upload photo with random tag friend. the program was

  • 0

im trying to make facebook upload photo with random tag friend.
the program was run correctly but i got stack on the array

$args = array(  
    'message' => 'Test Tags Text',  
    "access_token" => $access_token,  
    "image" => $files,
    'tags'    => $id,
); 

the $id is array friend list here the format

$friends = $facebook->api('/me/friends'); 
$frand = array_rand( $friends['data'], 20 );

foreach($frand as $fid){ 
    $id[$fid]['tag_uid'] =  $friends['data'][$fid]['id'];
$id[$fid]['x']  = 0;
$id[$fid]['y']  = 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:25:22+00:00Added an answer on May 23, 2026 at 6:25 am

    Update 2:

    Please read about arrays: PHP manual arrays. Every element in an array has a key even if you don’t specify it. You cannot have an element in an array without key.

    There is a difference between defining an array, where you don’t have to specify keys, and printing the array, which gives you a textual representation of the array.

    Update: So it seems it has to be

    $args['tags'] = $id;
    

    $id is already an array. If you pass it to array, it will create a new array with the $id as first element.


    Old answer:

    You are already talking about merge. Have you had a look at array_merge[docs]?

    $args['tags'] = array_merge($args['tags'], $id);
    

    Of course, $args['tags'] = array( $id ); does not work. It

    1. Overwrites the already existing value of $args['tags'].
    2. As you already noticed, it adds $id which is already an array, to an array. If $args['tags'] does not have a value, you could just do $args['tags'] = $id;.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to upload a photo to a user's Facebook and then tag
I am trying to make App Distribution from Facebook for android apps. But the
I am trying to make a class to handle all my interactions with Facebook.
I am trying to make an application which integrates facebook and twitter. I have
I'm trying to make an application that can connecto to facebook. I've found Facebook
I have a puzzling problem with trying to make an ajax/static state program. What
Using the Roles dashboard, I can create Facebook test user accounts but when trying
im trying to make a facebook like blue bar. So, i noticed they make
I'm trying to make a facebook app version of an existing page and am
I need help with Facebook OAuth. I am trying to make a facebook news

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.