francis Aneke Posted April 21, 2014 Share Posted April 21, 2014 (edited) I fetched some variables from the database which are stored in $join and the values are there when echoed $join ="$index_id||$weekly_gen_news||$what_is_env"; <li><a href='echo.php?GetValue=<?php echo $join; ?>' target='iframe_a'><span>what is environment</span></a></li> but the reason i did that is to parse them together to the next page, being separated by || At the echo.php i tried to explode them to their individual self and display them but i keep geting $index_id--$weekly_gen_news--$what_is_env as result, as echoed below What should i do? // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// echo.php <?php$GetValue = $_GET['GetValue']; //put content in array$array = explode("||", $GetValue[0]);$index_id = $array[0];$weekly_gen_news = $array[1];$what_is_env = $array[3];echo '$index_id--$weekly_gen_news--$what_is_env';?> Edited April 21, 2014 by francis Aneke Link to comment Share on other sites More sharing options...
Ingolme Posted April 21, 2014 Share Posted April 21, 2014 A string delimited by single-quotes won't parse the variables within it. You can read about strings and variables here: http://es1.php.net/manual/en/language.types.string.php Link to comment Share on other sites More sharing options...
francis Aneke Posted April 21, 2014 Author Share Posted April 21, 2014 i have solved it, the problem is that i forgot to put the third parameter $array = explode("||", $GetValue[0]);---->$array = explode("||", $GetValue,3); and i need not to index the GetValue variable directly. Then i finally echoed them individually like this echo $index_id = $array[0];echo$weekly_gen_news = $array[1];echo $what_is_env = $array[3]; so it now working perfectly THANKS ingolme Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now