Find Jobs
Hire Freelancers

Need help extracting variables from an Array

$10-11 USD

Completed
Posted 11 months ago

$10-11 USD

Paid on delivery
We have a php function which grabs data from an external server. When we run "print_r($response);" on the data that is retrieved, it outputs array data under 2 scenarios: ======= Scenario 1: ------- Array ( [properties] => Array ( [Time] => 2023-06-05 20:58:11+02:00 [Duration] => 61 [Amount] => 5.30 ) ) ------- Scenario 2: ------- Array ( [resources] => Array ( [0] => Array ( [properties] => Array ( [Time] => 2023-06-05 20:58:16+02:00 [Duration] => 50 [Amount] => 2.50 ) ) ) ) ------- Basically, I'd like to be able to extract values for "Time", "Duration", and "Amount" from the arrays under both scenarios above and assign them to corresponding php variables "$time", "$duration", and "$amount".
Project ID: 36710285

About the project

30 proposals
Remote project
Active 11 mos ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Lära känna To achieve this goal, we can create a custom function that will extract the required variables from both scenarios of the array data. This custom function can utilize the PHP function array_column() to capture the values associated with a given key, then assign these values to corresponding PHP variables. The elements inside of the two scenarios can have a different arrangement and number of elements; as long as the function is set up to loop through all of the possible elements it should be able to extract the right values. To create this custom function, I recommend the following steps: 1. Define a function such as "extractVariables($array, $arrayVariable)", where $array is the original array data returned from the external server and $arrayVariable is the name of the variable that will correspond to the array. 2. If the data obtained from the external server is not an array, then an error message should be returned. 3. Utilize a foreach loop that looks through the $array data to loop through each element. 4. For each element, use array_column() to extract the values associated with a given key. This will grab the values for “time”, “duration”, and “amount”, which can then be assigned to respective variables. 5. Outside of the loop, assign each extracted value to its corresponding array variable ($time, $duration, and $amount). 6. Lastly, return the newly created array variables. By following these steps, we can create a custom function to loop through the array data obtained from the external server and extract the appropriate values, then assign them to the corresponding variables. Best regards, Giáp Văn Hưng
$10 USD in 7 days
5.0 (101 reviews)
5.8
5.8
30 freelancers are bidding on average $13 USD for this job
User Avatar
Hello hiring member i can help you to print this variable i am 6 +years experience developer with php , laravel ,ajax, jquery , javascript, html,css, bootstrap i can start this right now so please give me chance to serve you thanks in advance :)
$20 USD in 1 day
5.0 (286 reviews)
8.1
8.1
User Avatar
Hello I have good experience in php. i can do this task. we can discuss in chat. payment will be after successful completion of work. thanks
$20 USD in 1 day
5.0 (62 reviews)
6.4
6.4
User Avatar
Hello there I will finish this now and I'm ready to start Thanks...........................................................
$11 USD in 1 day
4.9 (60 reviews)
6.1
6.1
User Avatar
Hi Dear client I am an expert web and PHP developer having 3+ years of experience in website development. I am ready to grab the values under both Scenario. I will give you 100% satisfaction with the requirements. You can check my previous work and reviews. Thanks Abdul
$11 USD in 1 day
5.0 (71 reviews)
6.2
6.2
User Avatar
Hello there! My name is MJ and I am an experienced JavaScript, JSON, PHP developer. I understand that you are looking for someone to help you extract variables from an Array and I believe I am the perfect person for the job. With my experience in JavaScript, JSON and PHP I am confident that I can tackle this project confidently. I have worked with a lot of different types of projects before and have always been able to produce high quality results. If given the chance to tackle this project I guarantee that you will not be disappointed with the results. I look forward to hearing more about your project and helping you achieve your goals as soon as possible!
$20 USD in 1 day
4.9 (141 reviews)
5.9
5.9
User Avatar
Yes I can handle both arrays and assign three variable values to PHP variables. I am working for more than 12 years in PHP. SO I have very good hand in php and array. I am available to do this right now. Thanks Ram
$11 USD in 7 days
5.0 (39 reviews)
5.9
5.9
User Avatar
Hello Sir! I am php expert and I can do this simple task for your asap. Lets come over chat and discuss further. Thanks.
$10 USD in 1 day
5.0 (113 reviews)
5.9
5.9
User Avatar
Dear, I would like to propose a solution for extracting data from PHP arrays as per your requirements. The solution involves analyzing the array structure, handling different scenarios, assigning values to variables, and providing output with thorough testing. The implementation will be customized to your specific needs and integrated into your existing PHP function. The timeline for this task will be discussed and finalized based on the complexity of the arrays and your project's urgency. Please let me know if you have any questions or if there are any specific details I should consider while working on this task. Looking forward to your positive response. Best regards, Maira Latif
$11 USD in 7 days
5.0 (22 reviews)
5.3
5.3
User Avatar
Hello, Yes, I can do this work and can extract values for "Time", "Duration", and "Amount" from the arrays and assign them to correspond php variables "$time", "$duration", and "$amount". I am ready to start the work right now. Thanks, Ankit
$50 USD in 1 day
4.9 (73 reviews)
5.5
5.5
User Avatar
Hello, My Name is Bhavesh Vyas, I am a skilled & experienced PHP developer. I have 10+ years of experience working in Html & PHP & Laravel,Livewire, Vue.js, React.Js, jQuery, MySQL, JavaScript, JSON API, AND AWS. I am ready to start working now Regards. Bhavesh Vyas
$10 USD in 1 day
5.0 (28 reviews)
4.0
4.0
User Avatar
Hi, I have faced this condition when creating a WordPress plugin and can solve this issue in minimum time, let me know so I can start straight away, Thanks
$20 USD in 1 day
5.0 (15 reviews)
3.8
3.8
User Avatar
Hi, hope you are doing well. I am core PHP & Laravel & CodeIgniter, WordPress web developer working since 2013.I have experience on variety of CMS, Frameworks and core Php & Mysql, SEO and Ftp & Cpanel Management. I have read your project description. I am very interested to work on your project. Please contact to discuss more on your project so that I can start work immediately. Regards Saeed
$10 USD in 1 day
4.2 (12 reviews)
3.9
3.9
User Avatar
I understand that you are looking for help extracting variables from an Array and I believe I am the best fit for this project. With my extensive experience in creating and maintaining multiple web applications that are scalable and performant, I am confident that I can deliver exactly what you are looking for. Specifically, I have expertise in backend frameworks such as Spring, Spring Boot, Struts and Django as well as frontend frameworks such as React.js, Redux and Angular.js which makes it easy for me to understand how your php function works. Additionally, I have experience in hosting web applications in AWS, Oracle cloud and Google cloud which makes it easier for me to handle this project at scale.
$11 USD in 7 days
5.0 (6 reviews)
3.1
3.1
User Avatar
Hello there! My name is Dusan and I'm an experienced JavaScript developer based in Serbia. I understand that you need help extracting variables from an Array, and I believe I am the perfect fit for the job due to my extensive experience in the field as well as my commitment to providing high-quality services. I have worked on many development projects throughout my career and have a track record of delivering exceptional results. My business philosophy revolves around four fundamental principles that guide my work - Client Satisfaction, Clear and Continuous Communication, Flexibility, and Fair Compensation for Quality Work. This commitment to quality ensures that you receive the best service possible while also maximizing client satisfaction. I would be delighted if you could give me the opportunity to help bring your project to fruition. Please feel free to contact me if you have any questions or would like to discuss further how I can help with this task at hand!
$15 USD in 7 days
5.0 (5 reviews)
2.8
2.8
User Avatar
Hi Buddy, I have 6 years of experience in web development. As i am Extensively Engaged In Developing High-end Database Driven Applications That Demands Enhanced Security Features And Database Optimization. Database Query Optimization Methods: 1. Multi Column Indexing 2. Mysql Slow Log Query 3. Optimization And Indexing 4. Full Text Search Indexing Methods Along With Security Steps: 1. Filtering Of External Data 2. Dispatch Methods 3. Naming Conventions 4. Error Reporting 5. Usage Of Sql Injections 6. Exposed Access Credentials 7. Session Fixation Etc. Look Forward To Hear From You.
$11 USD in 7 days
4.9 (6 reviews)
2.1
2.1
User Avatar
Dear Client, This is a small task and we would like to do this for you quickly. We are a skilled team of developers specializing in WebDesign, Angular, React, WordPress, MySQL, JavaScript, .NET, HTML, and PHP. Our extensive experience with these technologies allows us to deliver high-quality projects within budget and on time. We prioritize effective communication with stakeholders and employ the latest tools and techniques to ensure project success. We would be thrilled to collaborate with you on your project and demonstrate our ability to help you achieve your goals. Thank you for considering our team. Best regards,
$11 USD in 2 days
5.0 (2 reviews)
1.3
1.3
User Avatar
Dear Client! How are you? I’ve carefully checked your requirements and really interested in this job and I found my skills relevant to your project. I won't bother you with a long story as I know you have lots of proposals to read to find an appropriate candidate. Honestly, I possess all the skills and experience that you are looking for. If you are interested in my skills, please let me know here. I want to work with you for a long term. Could you discuss more details about your project please? Thanks. Regards Michael.
$10 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hello there! My name is Anupam, and I'm a PHP specialist with 6 years of experience in the IT industry. I have a solid background in Android development and the PHP framework that's most commonly used for web development. I understand you need help extracting variables from an Array and assigning them to corresponding php variables "$time", "$duration", and "$amount". With my expertise in PHP and Android development, I can provide the fastest, most reliable service possible so that you don't have to wait long for results. Additionally, I always respect milestone requirements so no matter how complicated the job may seem, I can guarantee complete accuracy in every piece of work. Plus, my offers include unlimited revisions, 24/7 support, and content writing on request so you can rest assured that your project will be completed correctly and on time. Let me know if you would like more information or would like me to start working on this project right away!
$10 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I am writing to express my interest in the position of extracting variables from an Array, as advertised on Python, Java, and C++. With my strong background in software development and expertise in data manipulation, I am confident in my ability to contribute to your team and deliver exceptional results. Having closely reviewed the job description, I understand that you require assistance with extracting variables from an Array. I have extensive experience working with arrays and data structures, and I am proficient in programming languages such as Python, Java, and C++. Over the years, I have successfully completed numerous projects that involved manipulating arrays to extract relevant information and perform complex calculations. Problem-solving abilities: I have a track record of solving complex problems by breaking them down into smaller, manageable tasks. This approach allows me to devise efficient algorithms for extracting variables from arrays. Attention to detail: I am meticulous when it comes to data analysis and validation. I always ensure that the extracted variables meet the required specifications and adhere to the project's objectives. Collaboration and communication: I thrive in team environments and have collaborated with cross-functional teams to deliver successful projects. I am an effective communicator and can convey technical concepts to both technical and non-technical stakeholders. Sincerely, Mohit
$11 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hello! I read your job description and understood what you need. I can do it in a few minutes. Please contact me and I will do it perfectly. Thank you!
$11 USD in 1 day
0.0 (0 reviews)
0.6
0.6

About the client

Flag of SWEDEN
Stockholm, Sweden
5.0
28
Payment method verified
Member since Dec 4, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.