Blogger Information
Blog 18
fans 0
comment 0
visits 13469
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
页面GET传参-4.16
太早的博客
Original
738 people have browsed it

实例

<?php
include __DIR__. '/public/include/header.php';
foreach($cates as $cate){
    echo "<h2>{$cate['alias']}</h2>";
    echo '<ol>';
    foreach($movies as $movie){
        if($cate['cate_id'] === $movie['cate_id']){
            echo "<li><a href='detail.php?mov_id=".$movie['mov_id']."'>{$movie['name']}</a></li>";
        }
    }
    echo '</ol>';
}
include __DIR__ . '/public/include/footer.php'; ?>

运行实例 »

点击 "运行实例" 按钮查看在线实例


实例

<?php
include __DIR__. '/public/include/header.php';
$mov_id = $_GET['mov_id'];
$mov_id = (int)$mov_id;
foreach($movies as $movie){
    if($movie['mov_id'] === $mov_id){
        echo "<h3>{$movie['name']}</h3>";
        echo '<img src="public/static/images/'.$movie['image'].'" width="300">';
        echo "<p>{$movie['detail']}</p>";
    }
}
include __DIR__ . '/public/include/footer.php'; ?>

运行实例 »

点击 "运行实例" 按钮查看在线实例


实例

<?php
include __DIR__. '/public/include/header.php';
$cate_id = $_GET['cate_id'];
$cate_id = (int)$cate_id;
foreach($cates as $cate){
    if($cate['cate_id'] === $cate_id){
        echo "<h2>{$cate['alias']}</h2>";
        echo '<ol>';
        foreach($movies as $movie){
            if($cate['cate_id'] === $movie['cate_id']){
                echo "<li><a href='detail.php?mov_id=".$movie['mov_id']."'>{$movie['name']}</a></li>";
            }
        }
        echo '</ol>';
    }
}
include __DIR__ . '/public/include/footer.php'; ?>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!