Help needed to get multiple values from one variable. its ve

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sakthi6600
Forum Newbie
Posts: 1
Joined: Tue Nov 15, 2011 11:34 pm

Help needed to get multiple values from one variable. its ve

Post by sakthi6600 »

Hi I am trying to create custom option. I am using the following code in one of the place. Now the help needed is,

I have to get multiple values in the array function with this variable $fb_new_text. I have already declared this $fb_new_text. But the result so far I get is, i can get only one value of the variable and even if i use multiple values in the variable as commas separated ones, the first value of the variable only I am getting.

Let me know how to get multiple values.

Code: Select all

function header_widget1() {
global $fb_footer_text1,$fb_new_text;

if(!is_page(array($fb_new_text))){
 ?>
<div id="header_widget_2">
<ul class="sidebar_list">
<?php echo(stripslashes (get_option('fb_footer_text1')));?>
</ul>
</div>
<?php 

}}
Last edited by Benjamin on Wed Nov 16, 2011 1:05 am, edited 1 time in total.
Reason: Added [syntax=php||htm||css||javascript||sql||etc] - Please use [syntax] tags when posting code in the forums! Thanks.
User avatar
manohoo
Forum Contributor
Posts: 201
Joined: Wed Dec 23, 2009 12:28 pm

Re: Help needed to get multiple values from one variable. it

Post by manohoo »

Let's try to understand what you want:
1. what is a custom option?
2. what is an array function?
3. is $fb_new_text an array or a single value variable?

In your function you go back and forth between php and html, I advise that you stay within php, and "echo" any html code.

Anyway... I believe that you need to master arrays and functions, you should spend a little time studying those.
Post Reply