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 9148687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:20:32+00:00 2026-06-17T11:20:32+00:00

The strings $test1 , $test2 , $test3 , and $test4 are created in the

  • 0

The strings $test1, $test2, $test3, and $test4 are created in the function test() . How can I print her?

My code:

conf.php

<?php
function test(){
    $test1 = 'test1 string';
    $test2 = 'test2 string';
    $test3 = 'test3 string';
    $test4 = 'test4 string';
}
?>

test.php

<?php 
require_once("conf.php");

test();
echo $test1;
echo $test2;
echo $test3;
echo $test4;
?>

Why code not worked?

Why weren’t $test1, $test2, $test3, and $test4 printed.

P.S.: preferably without globals parameters.

  • 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-06-17T11:20:35+00:00Added an answer on June 17, 2026 at 11:20 am

    for the multiple entities you have to use arrays.
    So, here is a general purpose solution.
    For the certain answer we need a certain question though

    function test() {
        $test[] = 'test1 string';
        $test[] = 'test2 string';
        $test[] = 'test3 string';
        $test[] = 'test4 string';
        return $test;
    }
    
    
    require_once "conf.php";
    
    $test = test();
    echo $test[0];
    echo $test[1];
    echo $test[2];
    echo $test[3];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a JQuery function that will test a string for the
I have this string <p/><ul><li>test1<p/></li><li>test2<p/></li></ul><p/> What i attempt to do is extract all the
Func<Classification, string> test1 = c => c.Id = x; Func<Classification, string> test2 = c
//string NSString *haystack = @.test {test:test} .test2{dasf:asdF}; //pattern NSString *needle = @[^{}]*{[^{}]*}; What I
I have the following: string test = CustomerNumber; or string test2 = CustomerNumberHello; the
I'm working on a searching function for my database. I've created a test DB
Regex \w seems to ignore my Unicode strings. I created the following function: extras.py
I've created a function to run through a vector of strings and remove any
I want to create SQL function with JDBC CREATE OR REPLACE FUNCTION TEST.TO_STRING( nt_in
public class Test1<Type> { public Type getCompositeMessage(Type... strings) { Type val = (Type) ;

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.