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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:23:22+00:00 2026-05-27T19:23:22+00:00

file capitais.php <?php /*Capitais*/ ini_set(‘display_errors’,1); ini_set(‘display_startup_erros’,1); error_reporting(E_ALL); require_once(‘dados.php’); $dados = new Dados; $estado =

  • 0

file capitais.php

   <?php
/*Capitais*/
ini_set('display_errors',1);
ini_set('display_startup_erros',1);
error_reporting(E_ALL);
require_once('dados.php');
$dados = new Dados;
$estado = $dados->_estado;
$capitais = $dados->_capitais;
for($i=1;$i<count($estado);$i++){
    echo $estado["$i"].' : '.array_search($capitais["$i"],$dados->cidades["$i"]).'<br />';
}
?>

file dados.php

    <?php

class Dados{
        public $_estado = array("Selecione","AC","AL","AM","AP","BA");
        public $_capitais = array("Selecione Primeiro o Estado","RIO BRANCO","MACEIO","MANAUS","MACAPA","SALVADOR");
        public function cidades($estado){
            switch($estado){
                case "1":
                    return array("Selecione","RIO BRANCO","RODRIGUES ALVES","SANTA ROSA","SENA MADUREIRA","SENADOR GUIOMARD","TARAUACA","XAPURI");
                break;
                case "2":
                    return array("Selecione","MACEIO","MAJOR ISIDORO","MAR VERMELHO","MARAGOGI","MARAVILHA","MARECHAL DEODORO","MARIBONDO");
                break;
                case "3":
                    return array("Selecione","MANAQUIRI","MANAUS","MANICORE","MARAA","MAUES","NHAMUNDA","NOVA OLINDA DO NORTE","NOVO AIRAO","NOVO ARIPUANA","PARINTINS","PAUINI","URUCURITUBA");
                break;
                case "4":
                    return array("Selecione","AMAPA","CALCOENE","MACAPA");
                break;
                case "5":
                    return array("Selecione","RUY BARBOSA","SALINAS DA MARGARIDA","SALVADOR","SANTA BARBARA");
                break;
            }
        }
    }
?>

Notice: Undefined property: Dados::$cidades in capitais.php on line 14

Warning: array_search() [function.array-search]: Wrong datatype for second argument in

  • 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-27T19:23:23+00:00Added an answer on May 27, 2026 at 7:23 pm
    $dados->cidades["$i"]
    

    should be

    $dados->cidades("$i")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

FILE *out=fopen64(text.txt,w+); unsigned int write; char *outbuf=new char[write]; //fill outbuf printf(%i\n,ftello64(out)); fwrite(outbuf,sizeof(char),write,out); printf(%i\n,write); printf(%i\n,ftello64(out));
File lstFile = new File(lstFileName).withWriter{out-> archivedFiles.each {out.println it.name} } archivedFiles is a List objects
FILE *new = fopen(new.out, w+); // creates a new file that didnt exist before
FILE : hello world foo bar How can I remove all the empty new
File -> New Project for ASP.NET MVC projects used to generate controllers with virtual
//file foo.php <?php namespace foo; class foo{ function __construct(){ echo hello; } } ?>
File folder2 = new File(C:\\Users\\user\\fypworkspace\\TextRenderer); File[] listOfFiles2 = folder.listFiles(); System.out.println(Please enter the required word
File f = new File(path) How to give the path parameter in this case?
I have slightly simplified the default index.php file supplied with WAMP, so that it
File mediaDir = new File(media); if (!mediaDir.exists()){ mediaDir.createNewFile(); mediaDir.mkdir(); } File f = new

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.