Become PHP Expert in 30 days
FreeMarriage.com - Free Online Matrimonial
FlashWebHost.com - Professional Web Hosting, Designing.
I didn't get answer when click on that link, why ?
http://php.flashwebhost.com/sherly/birds1.php
Code:<?php // create array $birds = array('crow', 'crane', 'eagle', 'parrot', 'hen', 'cock', 'sparrow', 'koel', 'peacock', 'myna'); // lets print echo $birds[1]; echo '<br>'; echo $birds[2]; echo '<br>'; echo $birds[4]; echo '<br>'; echo $birds[8];
I just copy/paste/uploaded your script
http://php.flashwebhost.com/sibichan/Day-5/birds1.php
Its working.
http://php.flashwebhost.com/sibichan...onstituent.php
PHP Code:
<?php
$constituentCountry = array(' Denmark ' , 'France ' , ' Netherlands ' , ' New Zealand ' , ' United Kingdom ');
echo '<h1>print_r() function example</h1>';
echo '<pre>';
print_r ($constituentCountry);
echo '<h1>var_dump() function example</h1>';
var_dump ($constituentCountry);
echo '</pre>';
http://php.flashwebhost.com/sibichan...ly_members.php
PHP Code:
<?php
$family = array('Father','Mother','Brother' , 'Sister');
$numberOfFamily = count($family);
echo ' I have ' . $numberOfFamily . ' members in my family .';
echo '<br>';
echo $family[0];
echo '<br>';
echo $family[1];
echo '<br>';
echo $family[2];
echo '<br>';
echo $family[3];
http://php.flashwebhost.com/annie/array_raw.php
Code:<?php $flowers = array('Jasmine','Rose','Orkid', 'Lotus'); echo 'My Favourit Flowers are ' . $flowers[1] . ' and ' . $flowers[3]; echo '<pre>'; print_r($flowers); echo '</pre>';
http://php.flashwebhost.com/annie/array_count.php
Code:<?php $states = array('Alappuzha', 'Ernakulam', 'Thiruvanthapuram', 'Kollam', 'Palakkad'); $numberOfStates = count($states); echo '<pre>'; print_r($states); echo '<p> I am going to add 2 more states to $states array. </p>'; $states[] = 'Kottayam'; $states[] = 'Kannur'; echo '<pre>'; print_r ($states); echo '</pre>';
http://php.flashwebhost.com/sibichan...ch-example.php
Another Example for foreachPHP Code:
<?php
$vechicles= array ('Bus' , 'Car' , 'Van' , 'Auto');
foreach ($vechicles as $vechicle) {
echo $vechicle;
echo '<br>';
}
http://php.flashwebhost.com/sibichan.../ssnetwork.php
PHP Code:
<?php
$networkingSites = array('Facebook' , 'Twitter' , 'Pinterest' , 'Delicious' );
foreach ($networkingSites as $networkingSite) {
echo $networkingSite;
echo '<br>';
}
Last edited by Vahaa11; 05-14-2014 at 07:25 AM.
http://php.flashwebhost.com/mini/array.php
Code:<?php $animals = array('lion', 'dog', 'cat', 'horse', 'rabit', 'tiger', 'rabit', 'camel', 'deer', 'fox', 'squirrel'); echo $animals[0]; echo '<br>'; echo $animals[2]; echo '<br>'; echo $animals[3]; echo '<br>'; echo $animals[5]; echo '<br>'; echo $animals[10];
http://php.flashwebhost.com/sibichan...y_add_eg_1.php
Another examplePHP Code:
<?php $hostingPackage = array (' Small ', ' Medium ' , ' Large ') ;
echo '<pre>';
print_r($hostingPackage);
echo '</pre>';
$hostingPackage [] = 'Premium';$hostingPackage [] = 'Starandard';
echo '<pre>';
print_r($hostingPackage);echo '</pre>';
http://php.flashwebhost.com/sibichan...y_add_eg_2.php
PHP Code:
<?php
$companyNames = array('BizHat', 'FlashWebHost', 'HostOnNet');
echo '<pre>';
print_r($companyNames);
echo '</pre>';
echo 'Iam going to add 2 more Company Names';
echo '<br>';
$companyNames[] = 'Buyscripts';
$companyNames[]= 'FreeMarriage';
echo '<pre>';
print_r($companyNames);
echo '</pre>';
Last edited by Vahaa11; 05-14-2014 at 08:59 AM.
http://php.flashwebhost.com/sherly/statesname.php
Code:<?php $states = array('Kerala' , 'Tamil Nadu' , 'Karnataka' , 'Rajastan' , 'Orissa' ); $numberOfStates = count($states); echo '<pre>'; print_r($states); echo '<p> I am going to add 2 more states to $states array. </p>'; $states[] = 'Kerala'; $states[] = 'Tamil Nadu'; echo '<pre>'; print_r ($states); echo '</pre>';
Last edited by sherlyk; 05-14-2014 at 09:33 AM.
Bookmarks