$firstChar = substr(trim($_POST["music"]),0,1);
if(ord($firstChar)>128){
  $firstChar = substr(trim($_POST["music"]),0,2);
}

解决方案 »

  1.   


    $m=$_POST['music'];
    echo $m{0};
      

  2.   


    $str = substr($_POST["music"],0,1);
    var_dump($str);
      

  3.   

    谢楼上几位老大,但我还是不会写这个查询结果页面,不好意思,刚开始研究php
      

  4.   

    终于解决了,谢楼上几位!!<?
    $voice=$_POST['music'];
    ?>
    <bgsound src="http://www.12345.com.cn/music/audio/<?php
    $str = substr($_POST["music"],0,1);
    echo strtoupper($str);//将取得的首字符输出为大写字母
    ?>/<?php
    echo strtolower("$music");//将取得的值转换为小写
    ?>.mp3" loop="1">效果达到了,就是这种用法对不对,管他的