Jump to content
php.lv forumi

blackhalt

Reģistrētie lietotāji
  • Posts

    763
  • Joined

  • Last visited

Posts posted by blackhalt

  1. Tie, kas nenorāda darba samaksu, un tādā garā, ir scameri:

     

    http://en.wikipedia.org/wiki/Scam

     

    A confidence trick is an attempt to defraud a person or group by gaining their confidence. A confidence artist is an individual operating alone or in concert with others who exploits characteristics of the human psyche such as dishonesty and honesty, vanity, compassion, credulity, irresponsibility, naivety and greed.

     

    Ievāks DB un taisīs augšā darba meklētāju portālu :D

  2. un kā tad es varu viņus izvadīt kā vienu?

    :) Nepārbaudīju vai baigi pareizi darbojas $matches un tā, bet apmēram tā. array() vispirms ņem pirmo, tad otro un tāda garā.

    <?php
    
    function media_check($status_text)
    {
       	$matches = array(
    '/((https?|ftp).*(gif|png|jpg|jpeg))/i',
    '/([\w\.-]+)(@)([\w\.-]+)/e',
    '/( http:\/\/)([\w\.-]+)/e',
    '/( www.)([\w\.-]+)/e',
       	);
    
       	$replacements = array(
    '<img src="$1" />',
    '"<a href=\"mailto:\\0\">\\0</a>"',
    '"<a href=\"\\0\" target=\"_blank\">\\0</a>"',
    '"<a href=\"http://\\0\" target=\"_blank\">\\0</a>"',
       	);
    
    $status_text = preg_replace($matches, $replacements, $status_text);
    
     return $status_text;
    }
    
    $rinda='[email protected] http://bh.id.lv/epasts.png  http://bh.id.lv ';
    
    echo media_check($rinda);
    
    
    ?>
    

  3. Ar mūsu laika zonām sanāk normāli

     

    Parīze:

     

    <?php
    
    date_default_timezone_set('Europe/Paris');
    
    # I (capital i)  Whether or not the date is in daylight saving time  1 if Daylight Saving Time, 0 otherwise.
    
    echo date('I',1332637199)."\n";
    echo date('I',1332637200)."\n";
    
    echo date('r',1332637199)."\n";
    echo date('r',1332637200)."\n";
    
    echo date('r',1332637199)."\n";
    echo date('r',1332637199 + 10800)."\n";
    ?>
    

     

    Visdrošāk ir lietot Unix timestamp, jo pat Āfrikā tas nemainās ;)

  4. Lūdzu atceries, ka tas bija tikai kā piemērs, necentos meklēt valūtas kursu, bet vienkārši paņēmu to, ko google izmeta ierakstot LVL to LTL :) .

     

    Varētu derēt, ka topika autoram vajag visu gatavu.

     

    Man ir index.htm fails un esmu uztaisījis input.js failu. Kas man katrā failā jaliek iekšā īsti? Man šitas .js ir absolūti melna bilde.

     

    Gribēšu redzēt, kā topika autors dabūs valūtas kursu no Latvijas bankas mājaslapas.

  5. javaskripts.php

     

    <?php
    header('content-type: text/javascript; charset=utf-8');
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
    header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
    header('Cache-Control: no-store, no-cache, must-revalidate');
    header('Cache-Control: post-check=0, pre-check=0', false);
    header('Pragma: no-cache');header('HTTP/1.1 200 Ok');
    # Zemāk kaut kāds saturs
    ?>
    

  6. <?php
    libxml_use_internal_errors(true);
    $sxe = simplexml_load_file("test.xml");
    if (!$sxe) {
    echo "Failed loading XML\n";
    foreach(libxml_get_errors() as $error) {
       	echo "\t", $error->message;
    }
    } else{
    print_r($sxe);
    }
    ?>
    

    http://lv.php.net/ma...ples-errors.php

     

    un tad kaut kā tā:

    <?php
    libxml_use_internal_errors(true);
    foreach (glob("*.xml") as $filename)
    {
    
    $sxe = simplexml_load_file($filename);
    if (!$sxe) {
       	echo "Failed loading XML\n";
       	foreach(libxml_get_errors() as $error) {
       	echo "\t", $error->message;
       	}
    } else{
    print_r($sxe);
    }
    }
    ?>
    

×
×
  • Create New...