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

  • Home
  • SEARCH
  • 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 3600376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:29:14+00:00 2026-05-18T20:29:14+00:00

Okay so I’m fairly new to PHP and I am currently experimenting with arrays.

  • 0

Okay so I’m fairly new to PHP and I am currently experimenting with arrays. As an example, lets assume this is my array:

    $t1 = array (
  "basicInfo" => array (
   "The Sineps",
   "December 25, 2010",
   "lemonpole_1g"
  ),
  "overallRecord" => array (
   "23",
   "12",
   "19",
   ""
  )
);

From what I could gather, I found out that the function array_splice allows me to point to a specific index in the array and add/remove data. From all of the examples that I’ve seen using this function…only numeric arrays were used. Now my question is how would I point to [“overallRecord”][3](which is empty) for example, and update that field?

For further understanding that empty field is for “total points”:

$wins = $t1["overallRecord"][0] * 3;
$loss = $t1["overallRecord"][1];
$draw = $t1["overallRecord"][2];
$total = $wins + $draw;

So to sum it all up, I’d like to add the variable $total to [“overallRecord”][3]. It doesn’t necessarily have to be with array_splice, however, if you come up with a different method to achieve this try and keep it simple or add comments please 🙂

Thanks in advance!

  • 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-18T20:29:15+00:00Added an answer on May 18, 2026 at 8:29 pm

    If I understand correctly, simply do

    $t1["overallRecord"][3] = $total;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so im working on this php image upload system but for some reason
Okay let me do a better job explaining this. Assume I have a person
Okay, so first off, I'm fairly new to web design. But for a project
Okay this question is very simple: I have a facebook page, and a website.
Okay, I feel a bit foolish for having to ask this but I guess
Okay, so I have my post.php page. If you are not logged in, you'll
Okay, this is probably a very basic question; but, I'm just getting back in
okay so I have two arrays $array_one([a]=>2,[b]=>1,[c]=>1); $array_two([a]=>1,[b]=>2,[c]=>1); I want to be able to
Okay, so I'm not even sure how to ask this question (much less search
Okay,I've been following this tutorial http://coenraets.org/blog/android-samples/androidtutorial/ Basically it gives me exactly what i need

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.