本文整理汇总了PHP中h2函数的典型用法代码示例。如果您正苦于以下问题:PHP h2函数的具体用法?PHP h2怎么用?PHP h2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了h2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: courses_render
function courses_render($course)
{
$id = $course['Course_id'];
//h3("<a href='index.php?option=store&view=delete&v1=$id'>Remove Course</a>");
h2("Course number:" . $course['Course_number'] . " Name:" . $course['Name']);
p("<h3>Description: " . $course['Description'] . "</h3>");
//if (users_loggedIn()) {
//p("<a href='index.php?option=courses&view=delete&v1=$id'>Remove Course</a>");
//Course number:".$course['Course_number']." Name:".$course['Name'].";
//}
}
示例2: users_render
function users_render($user)
{
$role = $user['role'];
if ($role == "Professor") {
h2("<hr><b>Professors</b>");
p("User name:" . $user['username']);
p("User role:" . $role);
p("User email:" . $user['email']);
} else {
h2("<b>Students</b>");
p("User name:" . $user['username']);
p("User role:" . $role);
p("User email:" . $user['email']);
}
//h3("<a href='index.php?option=store&view=details&v1=$id'>Course number:".$course['Course_number']." Name:".$course['Name']."</a>");
//p("Description: ".$course['Description']);
//if (users_loggedIn()) {
//books_renderEnrollForm($course);
//}
}
示例3: view
function view($data)
{
startOfPage("students list vieww");
startContent();
siteTitle("Blackboard");
p("Welcome to Blackboard - Please Log in !");
$students = $data["users"];
if (!empty($students)) {
h2("List of students:");
foreach ($students as $student) {
students_render($student);
}
h2("List of professors:");
foreach ($students as $student) {
professors_render($student);
}
}
endContent();
endOfPage();
}
示例4: takeaway_heading
/**
*######################################################################
*# takeaway heading
*######################################################################
*/
function takeaway_heading($atts)
{
if (isset($atts['type'])) {
switch ($atts['type']) {
case 'h1':
return h1($atts);
break;
case 'h2':
return h2($atts);
break;
case 'h3':
return h3($atts);
break;
case 'h4':
return h4($atts);
break;
case 'h5':
return h5($atts);
break;
}
}
return '';
}
示例5: h2
The current texture is not automatic, you need to treat it like you do the other input variables, and explicitly set it from your C++ program. Since each entity can have a different
texture, and worse, there might be no way for you to get it and pass it to the shader, SFML provides a special overload of the <code>setParameter</code> function that
does this job for you.
</p>
<pre><code class="cpp">shader.setParameter("texture", sf::Shader::CurrentTexture);
</code></pre>
<p>
This special parameter automatically sets the texture of the entity being drawn to the shader variable with the given name. Every time you draw a new entity, SFML will update the shader
texture variable accordingly.
</p>
<p>
If you want to see nice examples of shaders in action, you can have a look at the Shader example in the SFML SDK.
</p>
<?php
h2('Using a sf::Shader with OpenGL code');
?>
<p>
If you're using OpenGL rather than the graphics entities of SFML, you can still use <?php
class_link("Shader");
?>
as a wrapper around an OpenGL program object and use it
within your OpenGL code.
</p>
<p>
To activate a <?php
class_link("Shader");
?>
for drawing (the equivalent of <code>glUseProgram</code>), you have to call the <code>bind</code> static function:
</p>
<pre><code class="cpp">sf::Shader shader;
示例6: h2
</p>
<pre><code class="cpp">sound.setVolume(50);
</code></pre>
</p>
The <em>loop</em> attribute controls whether the sound/music automatically loops or not. If it loops, it will restart playing from the beginning when it's finished,
again and again until you explicitly call <code>stop</code>. If not set to loop, it will stop automatically when it's finished.
</p>
<pre><code class="cpp">sound.setLoop(true);
</code></pre>
<p>
More attributes are available, but they are related to spatialization and are explained in the
<a class="internal" href="./audio-spatialization.php" title="Spatialization tutorial">corresponding tutorial</a>.
</p>
<?php
h2('Common mistakes');
?>
<h3>Destroyed sound buffer</h3>
<p>
The most common mistake is to let a sound buffer go out of scope (and therefore be destroyed) while a sound still uses it.
</p>
<pre><code class="cpp">sf::Sound loadSound(std::string filename)
{
sf::SoundBuffer buffer; // this buffer is local to the function, it will be destroyed...
buffer.loadFromFile(filename);
return sf::Sound(buffer);
} // ... here
sf::Sound sound = loadSound("s.wav");
sound.play(); // ERROR: the sound's buffer no longer exists, the behavior is undefined
示例7: h2
h2("LatLngBounds class: maximum bounds in GMaps");
$bounds3 = new LatLngBounds(new LatLng(-85.051128779807, -180), new LatLng(85.051128779807, 180));
h3("Constructor (new LatLng(-85.051128779807, -180), new LatLng(85.051128779807, 180))");
p($bounds3->toString());
h3("getCenter()");
p($bounds3->getCenter()->toString());
h3("getSouthWest()");
p($bounds3->getSouthWest()->toString());
h3("getNorthEast()");
p($bounds3->getNorthEast()->toString());
h3('contains(moscow)');
p($bounds3->contains($moscow));
h3('contains(sydney)');
p($bounds3->contains($sydney));
h3('contains(buenosaires)');
p($bounds3->contains($buenosaires));
h2('Spherical geometry static class');
h3('computeArea(london, donostia, newyork)');
p(float_to_string(SphericalGeometry::computeArea(array($london, $donostia, $newyork))));
h3('computeSignedArea(london, donostia, newyork)');
p(float_to_string(SphericalGeometry::computeSignedArea(array($london, $donostia, $newyork))));
h3('computeDistanceBetween(london, newyork)');
p(float_to_string(SphericalGeometry::computeDistanceBetween($london, $newyork)));
h3('computeHeading(london, newyork)');
p(float_to_string(SphericalGeometry::computeHeading($london, $newyork)));
h3('computeLength(london, newyork, moscow, sydney)');
p(float_to_string(SphericalGeometry::computeLength(array($london, $newyork, $moscow, $sydney))));
h3('computeOffset(london, 5576353.232683, -71.669371)');
p(SphericalGeometry::computeOffset($london, 5576353.232683, -71.669371)->toString());
h3('interpolate(newyork, sydney, 0.7)');
p(SphericalGeometry::interpolate($newyork, $sydney, 0.7)->toString());
示例8: var_dump
var_dump($out_f5);
// int(10)
$out_f5 = f5();
var_dump($out_f5);
// int(11) [**]
/*
* actual_paramter ::= '&' VARIABLE
*
* Note the discrepency between this and the previous test.
* - If a function _returns_ a symbol table entry, the associated assignment
* must also be =& (and not just =; cf. test above)
* - For a function to _accept_ a symbol table entry, there is a choice:
* either you add the & to the formal parameter, or you add the & to the
* actual parameter (both is allowed too).
*/
function h1($in_h1)
{
$in_h1++;
}
$out_h1 = 5;
h1(&$out_h1);
var_dump($out_h1);
// Outputs 6
function h2(&$in_h2)
{
$in_h2++;
}
$out_h2 = 5;
h2(&$out_h2);
var_dump($out_h2);
// Outputs 6
示例9: transformations
{
// collision!
}
</code></pre>
<p>
La fonction est nommée <code>getGlobalBounds</code> car elle renvoie la boîte englobante de l'entité dans le système de coordonnées global, c'est-à-dire avec toutes
ses transformations (position, rotation, échelle) appliquées.
</p>
<p>
Il existe une autre fonction, qui renvoie la boîte englobante de l'entité dans son système de coordonnées <em>local</em> (sans les transformations) :
<code>getLocalBounds</code>. Cette fonction peut être utilisée pour récupérer la taille initiale de l'entité, par exemple, ou bien pour effectuer des calculs
plus spécifiques.
</p>
<?php
h2('Les hiérarchies d\'objets (scenegraph)');
?>
<p>
Avec les transformations persos vues précédemment, il est maintenant facile d'implémenter une hiérarchie d'objets, où les enfants sont transformés relativement à leur
parent. Tout ce que vous avez à faire est de passer la transformation combinée du parent aux enfants lorsque vous les dessinez, jusqu'à ce que vous atteignez les
entités dessinables finales (sprites, textes, formes, vertex arrays ou bien vos propres 'drawables').
</p>
<pre><code class="cpp">// la classe de base abstraite
class Node
{
public:
// ... fonctions pour transformer le noeud
// ... fonction pour gérer les enfants du noeud
示例10: applications
</p>
<p>
It's up to you to decide which solution is the best for you.
</p>
<p>
Note : none of the SFML modules requires a library which is not already installed by default on Mac OS X,
except the Audio module which requires the OpenAL and libsndfile libraries. So you'll have to provide them
together with your applications (see the extlibs/bin directory of the downloaded disk image). If you use the 64-bit version
of SFML, you don't have to provide the OpenAL framework. Note that you can find the
OpenAL framework in the system's folders, however the version delivered with Mac OS X 10.4 is not working well,
that's why we provide a recompiled version with SFML.
</p>
<?php
h2('Compiling SFML (for advanced users)');
?>
<p>
To compile the SFML frameworks and samples, you first have to download the full SDK
(see the <a class="internal" href="../../download.php" title="Go to the download page">download page</a>).
</p>
<p>
Go to the SFML-x.y/build/xcode directory and open the SFML.xcodeproj project (compatible with Xcode 2.4 and +).
According to what you need, choose the target (Debug or Release), and launch the compile process. It can last
a few minutes, depending on the power of your PC. You will then find the built frameworks in the
SFML-x.y/lib directory (or SFML-x.y/lib64 if you chose to compile SFML for 64-bit processors with the
"SFML with Intel 64-bit.xcodeproj" project).
</p>
<p>
Similarly, if you want to create the raw dynamic libraries, you can use the SFML-bare.xcodeproj project.
The compile process produces dynamic libraries (files with the "dylib" extension) in the same
示例11: h2
<li><a href="graphics-sprite.php" title="Sprites and textures">Sprites and textures</a></li>
<li><a href="graphics-text.php" title="Text and fonts">Text and fonts</a></li>
<li><a href="graphics-shape.php" title="Shapes">Shapes</a></li>
<li><a href="graphics-vertex-array.php" title="Designing your own entities with vertex arrays">Designing your own entities with vertex arrays</a></li>
<li><a href="graphics-transform.php" title="Position, rotation, scale: transforming entities">Position, rotation, scale: transforming entities</a></li>
<li><a href="graphics-shader.php" title="Adding special effects with shaders">Adding special effects with shaders</a></li>
<li><a href="graphics-view.php" title="Controlling the 2D camera with views">Controlling the 2D camera with views</a></li>
</ul>
<?php
h2('Audio module');
?>
<ul>
<li><a href="audio-sounds.php" title="Playing sounds and music">Playing sounds and music</a></li>
<li><a href="audio-recording.php" title="Recording audio">Recording audio</a></li>
<li><a href="audio-streams.php" title="Custom audio streams">Custom audio streams</a></li>
<li><a href="audio-spatialization.php" title="Spatialization">Spatialization: Sounds in 3D</a></li>
</ul>
<?php
h2('Network module');
?>
<ul>
<li><a href="network-socket.php" title="Communication using sockets">Communication using sockets</a></li>
<li><a href="network-packet.php" title="Using and extending packets">Using and extending packets</a></li>
<li><a href="network-http.php" title="Web requests with HTTP">Web requests with HTTP</a></li>
<li><a href="network-ftp.php" title="File transfers with FTP">File transfers with FTP</a></li>
</ul>
<?php
require "footer.php";
示例12: h2
$export_print = HtmlInput::print_window();
$export_csv = '<FORM METHOD="get" ACTION="export.php" style="display:inline">';
$export_csv .= HtmlInput::hidden('cat', $_GET['cat']);
$export_csv .= HtmlInput::hidden('act', 'CSV:fiche_balance');
$export_csv .= HtmlInput::hidden('start', $_GET['start']);
$export_csv .= HtmlInput::hidden('end', $_GET['end']);
$export_csv .= HtmlInput::hidden('histo', $_GET['histo']);
$export_csv .= HtmlInput::request_to_hidden(array('allcard'));
$export_csv .= dossier::hidden();
$export_csv .= HtmlInput::submit('CSV', 'Export en CSV');
$export_csv .= '</FORM>';
/*
* Date is important is requested balance
*/
if (isDate($_REQUEST['start']) == null || isDate($_REQUEST['end']) == null) {
echo h2('Date invalide !', 'class="error"');
alert('Date invalide !');
return;
}
/*************************************************************************************************************************
* Balance agée tous
/*************************************************************************************************************************/
if ($_GET['histo'] == 6) {
require_once NOALYSS_INCLUDE . '/class_balance_age.php';
$bal = new Balance_Age($cn);
$export_csv = '<FORM METHOD="get" ACTION="export.php" style="display:inline">';
$export_csv .= HtmlInput::request_to_hidden(array('gDossier', 'ac', 'p_let', 'p_date_start'));
$export_csv .= HtmlInput::hidden('p_date_start', $_GET['start']);
$export_csv .= HtmlInput::hidden('act', 'CSV:balance_age');
$export_csv .= HtmlInput::hidden('p_let', 'let');
$export_csv .= HtmlInput::hidden('p_type', 'X');
示例13: head
head('jMList');
topheading('home');
open('div', array('id' => 'body'));
h2('Overview');
$_jMList = txttag('span', array('class' => 'jmlist'), 'jMList');
$_XML = acronym('XML', 'eXtensible Markup Language');
$_HTML = acronym('HTML', 'HyperText Markup Language');
$_XSL = acronym('XSL', 'eXtensible Stylesheet Language');
$_RDF = acronym('RDF', 'Resource Description Framework');
$_RSS = acronym('RSS', 'RDF Site Summary');
tag('p', array(), "{$_jMList} is a small utility that scans one or more given " . "directories for media files (currently only audio files) and " . "generates a {$_XML} listing of the whole directory tree with " . "information about each media file such as filesize, song length, " . "title, author, album, etc. A {$_XSL} stylesheet can be applied to " . "the output to transform into a different output, like tabular or " . "tree listings in plain text, {$_XML}, {$_HTML}, {$_RDF}, {$_RSS} or any " . "other {$_XML} format.");
$_MP3 = acronym('MP3', 'MPEG Layer-3');
$_FLAC = acronym('FLAC', 'Free Lossless Audio Codec');
tag('p', array(), "{$_jMList} is still in its earlier stages of developement, but it " . "already supports identification of {$_MP3} and OGG files and is capable " . "of extracting meta-information from ID3, ID3v2 and Vorbis tags.");
tag('p', array(), "{$_jMList} is released under the " . a('GNU', 'http://www.gnu.org/') . " " . a('General Public License', 'http://www.gnu.org/licenses/gpl.html') . ".");
h2('Features');
tag('p', array(), "The following features are currently supported by {$_jMList}:");
open('ol', array());
tag('li', array(), "Internally transform output through {$_XSL}.");
tag('li', array(), "Parsing information from MPEG Layer 1, 2 and 3 ({$_MP3}) files, both ID3 v1 and v2 tags.");
tag('li', array(), "Parsing information from Ogg Vorbis (OGG) files.");
tag('li', array(), "Full Unicode support.");
tag('li', array(), "Parsing data in UTF-8 and ISO8859-1 encondings from ID3 tags.");
close();
tag('p', array(), "The following features are planned to be supported:");
$_NLS = acronym('NLS', 'National Language Support');
$_i18n = acronym('i18n', 'internationalization');
open('ol');
tag('li', array(), "Detect and parse data from tags based on an user-provided list of possible character encodings.");
tag('li', array(), "Properly support files > 2GiB.");
tag('li', array(), "National Language ({$_NLS}, {$_i18n}) support");
示例14: size
It is this simple "L" prefix in front of the string that makes it work by telling the compiler to produce a wide string. Wide strings are a strange beast
in C++: the standard doesn't say anything about their size (16-bit? 32-bit?), nor about the encoding that they use (UTF-16? UTF-32?). However
we know that on most platforms, if not all, they'll produce Unicode strings, and SFML knows how to handle them correctly.
</p>
<p>
Note that the C++11 standard supports new character types and prefixes to build UTF-8, UTF-16 and UTF-32 string literals, but SFML doesn't support
them yet.
</p>
<p>
It may seem obvious, but you also have to make sure that the font that you use contains the characters that you want to draw. Indeed, fonts
don't contain glyphs for all possible characters (there are more than 100000 in the Unicode standard!), and an arabic font won't be able to display japanese
text, for example.
</p>
<?php
h2('Making your own text class');
?>
<p>
If <?php
class_link('Text');
?>
is too limited, or if you want to do something else with pre-rendered glyphs, <?php
class_link('Font');
?>
provides
everything that you need.
</p>
<p>
You can retrieve the texture which contains all the pre-rendered glyphs of a certain size:
</p>
<pre><code class="cpp">const sf::Texture& texture = font.getTexture(characterSize);
示例15: h1
echo "Done\n";
//*/
///*
echo "----- test using literals, constants, and arbitrary-complex expressions ----\n";
//$a =& 12; // literals are disallowed
//$a =& CON; // constants are disallowed
$b = 10;
$a =& $b;
echo "After '=&', \$a is {$a}, \$b is {$b}\n";
//$a =& 5 + $b; // arbitrary-complex expressions are disallowed
echo "After '=&', \$a is {$a}, \$b is {$b}\n";
function h1()
{
$b = 10;
return $b + 5;
// return 12;
// return CON;
}
echo "h1() is " . h1() . "\n";
//*/
///*
function &h2()
{
$b = 10;
// return $b + 5; // Only variable references should be returned by reference
// return 12;
// return CON;
}
h2();
echo "Done\n";
//*/