Skip to content

PHP codes and news

Open Menu

Author: user

May 25, 2012

PHP: Créer une connexion à une base de données

<html>
<head>
<title>Base de données</title>
</head>
<body>

<?php

  $hote="localhost"; //définir 
user
May 24, 2012

Vérifier si une valeur est numérique ou non

<?php
$a = 25;
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = 25.5;
echo 
user
May 23, 2012

Utilisation des Balises HTML dans l’affichage

 <html>
  <head>
   <title>Formatage HTML</title>
  </head>
 <body>

<?php

 $design="<select size='
user
May 22, 2012

Vérifier si méthode, une fonction ou une classe existe déjà

<?php
/*
bool function_exists (string nom_fonction)
bool method_exists (object objet, string nom_me
user
May 20, 2012

Conversion hexadécimale avec la fonction ‘base_convert()’

<html>
<head>
<title> Fonction Mathématique</title>
</head>
<body>
<?php

$hex = 'a1'; // Nombre hex
user
May 19, 2012

Obtenir le type d’une instance ou d’une variable avec ‘gettype( )’

<?php
class Personne {
}


$elem = new Personne(  );
echo gettype($elem);
$x=15;
echo gettype($x);
user
May 18, 2012

Découper le lien d’un fichier

<?php
$nom_complet_rep = '/usr/local/php/php.ini';
$base = basename($nom_complet_rep);
echo $base."
user
May 17, 2012

Traitement d’une structure stockée

<?php
$bdh = dba_open('etudiant.db','c','gdbm') or die($php_errormsg);

if ($exists = dba_exists($_
user
May 16, 2012

Calcul de cosinus de l’arc avec la fonction ‘acos()’

		 <html>
		 <head>
		 <title> Fonction Math 'acos()'</title>
		 </head>
		 <body>
		 <table>
		 <t
user
May 15, 2012

Déplacer un fichier avec la méthode ‘copy()’

<?php
// Fonction pour déplacer un fichier
     function deplacer($source, $dest)
     {
          
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