473,383 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do I output this array into another PHP?

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa
Jan 2 '15 #1
1 1377
Exequiel
288 256MB
Did you mean to other php page? if that so you can try this sample below.
First page.
page1.php
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. ob_start();
  3. session_start();
  4.  
  5. $_SESSION['country'] = array("USA", "CHINA", "PHILIPPINES");
  6. echo '<br><a href="page2.php">Other page</a>';
  7. ?>
  8.  
second page.
page2.php
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. ob_start();
  3. session_start();
  4. $country = $_SESSION['country'];
  5. echo "I like " . $country[0] . ", " . $country[1] . " and " . $country[2] . ".";
  6. echo '<br><a href="page1.php">back</a>';
  7. ?>
  8.  
here we put the array content to our session country so that we can view the data to other php pages for your system.
try it.
Jan 2 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: jerrygarciuh | last post by:
Hello, I have a client who has decided to output the OO PHP/mySQL site I have made for them onto a cd. I realize that $html = include('somefile.php'); gets 1 for success as its return value....
1
by: Rick Strahl [MVP] | last post by:
I often have the need to run templates that perform the equivalent of a mail merge as part of the processing for another page. For example, I have an invoice display page in my admin module and...
16
by: Byte | last post by:
Probably a stupid question, but I'm a newbie and this really pisses me off. Run this script: import random def Func1(): choice = ('A', 'B', 'C') output = random.choice(choice) def Func2():
1
by: Paul | last post by:
Hi all, I've hit a strange problem with my ASP .NET site - occasionally when I go to a page, it will have part of another request's output mixed in with my output. This breaks the HTML on the...
2
by: jmr | last post by:
Hi All, I've found a post in google group about this problem but unfortunately, there was no answer. Sorry to ask again but maybe the initial poster has a fix now. The problem we have with...
5
by: Stephen3776 | last post by:
I am doing an inventory control progam and trying to output a multiple array, I am getting an illegal conversion error java.lang.double !d. Can somebody tell me what I am doing wrong or if there is...
2
by: Oli Thissen | last post by:
Hello everybody! I'm having a little problem with the following: I wrote a class to collect data (Let's call it DataCollector). Now I want the data to be interpreted in various ways. My idea was...
4
by: joelf223 | last post by:
Hi, I'm trying to get this program to read, then print, the output from another short program (hw7.c) it compiles fine but then does not return the values I want it to. I'm assuming I have a...
0
by: Kanis | last post by:
Hi, I 'd to output an array to a file, however the "tofile" function can only work for <type numpy.ndarray> but not <type array>. So how can I change the <type array> to <type numpy.ndarray>? ...
4
by: ryokubaka | last post by:
I have a function that will read a file of numbers and place them into an array. I need to create a new function that will, given that stored array, output the array to a new file. This is the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.