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

  • Home
  • SEARCH
  • 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 6795475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:21:00+00:00 2026-05-26T18:21:00+00:00

being new to php i am not ble to figure out how to use

  • 0

being new to php i am not ble to figure out how to use if else inside php array. i tried to do something like this

function column_title($item){
        $status=false;
        if($item->uTestimonials_approval =='0')
           $status=false;
         else
          $status=true;

        //Build row actions
        $actions = array(
             $status ? 'unapprove'      => sprintf('<a href="?page=%s&action=%s&id=%s">Unapprove</a>',$_REQUEST['page'],'unapprove',$item-> uTestimonials_id),:
            'approve1'      => sprintf('<a href="?page=%s&action=%s&id=%s">Approve</a>',$_REQUEST['page'],'approve',$item-> uTestimonials_id),

            'delete'    => sprintf('<a href="?page=%s&action=%s&id=%s">Delete</a>',$_REQUEST['page'],'delete',$item-> uTestimonials_id),
        );

        //Return the title contents
        return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
            /*$1%s*/ $item-> uTestimonials_message,
            /*$2%s*/ $item-> uTestimonials_id,
            /*$3%s*/ $this->row_actions($actions)
        );
    }

but i am getting following parsing exception

Parse error: syntax error, unexpected T_DOUBLE_ARROW

can any one help me to find what exactly i am doing wrong thanks in advance

I am perfectly fine for negative voting but its always better to specify why some one did that so that person can improve him/herself

  • 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-05-26T18:21:01+00:00Added an answer on May 26, 2026 at 6:21 pm

    You cannot do this for a key value:

     $status ? 'unapprove'
    

    Try something like this instead:

        //Build row actions
        $ap = 'approve';
        $key = 'approve1';
        if($status){             
           $ap = 'unapprove';
           $key = 'unapprove';
        }
        $actions = array(
            $key => sprintf('<a href="?page=%s&action=%s&id=%s">'.$ap.'</a>',$_REQUEST['page'],$ap,$item-> uTestimonials_id),:
            'delete' => sprintf('<a href="?page=%s&action=%s&id=%s">Delete</a>',$_REQUEST['page'],'delete',$item-> uTestimonials_id),
        );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I figured this would be simple, but being new to SSRS I'm not sure.
Being new to test based development, this question has been bugging me. How much
Being new to Cocoa, and probably not knowing all of the potential classes available
being new to WPF this is a complex problem for me. What i want
Due to being new, I can only have two links and can not post
Goodmorning everybody! I'm not completely new to PHP as in self but still kinda
This if else statement does not work: (in this situation it displays 'x is
Being new to VS, how may I think of these two concepts, what is
Being new to both WPF and MVVM, I'm studying Josh Smith's article on the
Being new to c++ I've been practicing with questions. One program I wrote includes

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.