Skip to content

PHP codes and news

Open Menu
November 25, 2011

Accéder à une variable globale avec ‘$GLOBALS’

<?php

$langue = 'Anglais';

function apprendre_langue() {
    $GLOBALS['langue'] .= ' et français'
user
November 25, 2011

Création et utilisation des variables globales

<?php
$a = 10;
$b = 20;
function somme() {
    $GLOBALS['b'] = $GLOBALS['a'] + $GLOBALS['b'];
}
som
user
November 25, 2011

Exemple de tableau associtif pré-défini avec propriété

<html>
<head>
<title>tableau associatif</title>
</head>
<body>
<?php

$a = 0;
function test($x,$y)
{
user
November 25, 2011

Parcourir un tableau associatif pré-défini

<html>
<head>
<title>Tablea associatif pré-défini</title>
</head>
<body>
<?php
foreach ( $GLOBALS a
user
November 25, 2011

Modifier la valeur d’une variable globale


<?php
   $somme=0;
   function clacul($a,$b)
   {
     $GLOBALS["somme"]=$a+$b;
   }
   print "Val
user
November 25, 2011

PHP: Exemple des Variables Globales

<html>
<head>
<title>Using the global Statement to Remember the Value of a Variable Between Functio
user
November 25, 2011

Accéder à une variable globale

<html>
<head><title>Accès global</title></head>
<body>
<div>
<?php
    $artiste='Yannick noah';

  
user
November 24, 2011

Afficher dans un tableau les information DNS d’un nom de domaine

<?php
$enrgs = dns_get_record("www.yahoo.com");
print_r($enrgs);
?>

user
November 24, 2011

Afficher tous les types d’enregistrement DNS d’un host avec le constant ‘DNS_ALL’

<?php

    $hostname = "google.com";

    $enrgs = dns_get_record($hostname, DNS_ALL);

    foreach
user
November 24, 2011

Appel des MX(Mail Exchage) d’un hôte avec la fonction ‘dns_get_mx()’

<?php

    $domaine = "google.fr";
    if(dns_get_mx($domaine, $mxhosts, $weights))
    {

        
user

Posts navigation

Older posts
Newer posts

Recent Posts

  • Hello world!
  • PHP Session et Cookies: Exemple d’utilisation de session_start()
  • PHP: Fermer un fichier avec la fonction fclosde()
  • PHP: Vérifier si un élément est un répertoire
  • PHP: Vérifier si un fichier existe sinon le créer

Recent Comments

  1. A WordPress Commenter on Hello world!
© 2025 PHP codes and news
 / Theme: Really Simple / License: GPLv3