0

这是我的代码

PHP

<?php
    $count1 = $obj->getDatef();
    $as1 = $count1 + 6;
    $startdate = date('d/m/Y', strtotime($count1 . ' days'));
    $enddate = date('d/m/Y', strtotime($as1 . ' days'));

    echo "<script type='text/javascript'>";
    echo "alert('Current Timesheet period($startdate (Mon) ~ $enddate (Sun)) of 
              $pcode has been successfully Updated....!')";
    echo "</script>";
    echo "<script type='text/javascript'>";
    echo "window.location='my_tm.php'";
    echo "</script>";
?>

在这里它必须像这样打印......

当前时间表期间

$pcode 的 $startdate (Mon) ~ $enddate (Sun)

已成功更新......!

4

3 回答 3

0
echo "alert('Current Timesheet period\n
             $startdate (Mon) ~ $enddate (Sun) of $pcode\n
             has been successfully Updated....!')";

这是小提琴

于 2013-06-13T09:07:24.557 回答
0

有两种最流行的方法是在 echo 末尾使用 \n 来换行。或者您可以使用
效率较低的标签,因为它会为您的页面添加标记。

一个例子是

echo("im line one \n im line two\n im line three");

这将输出

im line one
im line two
im line three
于 2013-06-13T09:03:59.297 回答
0
echo "alert('Current Timesheet period\n$startdate (Mon) ~ $enddate (Sun) of $pcode\n has been successfully Updated....!')";
于 2013-06-13T09:12:12.530 回答