小编Mas*_*erZ的帖子

来自命令行的ms语音

有没有办法从命令行使用MS Speech实用程序?我可以在Mac上执行此操作,但在Windows XP上找不到任何对它的引用.

谢谢.

cmd text-to-speech

27
推荐指数
3
解决办法
6万
查看次数

Laravel默认.htaccess文件无效

我终于为Laravel安装了所有东西,但我的主页上收到错误500!

它看起来是我的.htaccess文件.如果我删除它页面工作.如果我把它放回去,另一个错误500.

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

如果我将第二行更改为"RewriteRule ^ index.php [L]"(在index.php之前没有空格),则错误500消失,但重写规则将不起作用.

我的主人是1and1.com.

有谁能够帮我?

.htaccess laravel

6
推荐指数
1
解决办法
2万
查看次数

使用PHP在docx文件中查找换行符

我的PHP脚本成功读取.docx文件中的所有文本,但我无法弄清楚换行符应该在哪里,因此它会使文本成束并且难以阅读(一个巨大的段落).我已经手动浏览了所有的XML文件,试图找出它,但我无法弄明白.

以下是我用来检索文件数据并返回纯文本的函数.

    public function read($FilePath)
{
    // Save name of the file
    parent::SetDocName($FilePath);

    $Data = $this->docx2text($FilePath);

    $Data = str_replace("<", "&lt;", $Data);
    $Data = str_replace(">", "&gt;", $Data);

    $Breaks = array("\r\n", "\n", "\r");
    $Data = str_replace($Breaks, '<br />', $Data);

    $this->Content = $Data;
}

function docx2text($filename) {
    return $this->readZippedXML($filename, "word/document.xml");
}

function readZippedXML($archiveFile, $dataFile)
{
    // Create new ZIP archive
    $zip = new ZipArchive;

    // Open received archive file
    if (true === $zip->open($archiveFile))
    {
        // If done, search for the data file in …
Run Code Online (Sandbox Code Playgroud)

php document ms-office

4
推荐指数
1
解决办法
3667
查看次数

Laravel 10 Unit Test does not see DB change from Artisan Command

I have an artisan command (Laravel 10) that makes a change to the user table in the database. I can confirm that the change is happening with output from the command itself, and it looks like it's actually working.

However, when I run the unit test, it does not see the updated database change.

Unit Test

public function test_promote_user_command_sets_user_as_super_admin()
{
    $user = $this->createUser('guest');

    $response = $this->artisan("user:promote {$user->email}")->assertSuccessful();

    $role = Role::where('name', '=', 'Super Admin')->first();
    $this->assertDatabaseHas('users', [
        'id' => $user->id,
        'role_id' => …
Run Code Online (Sandbox Code Playgroud)

php testing tdd laravel laravel-artisan

3
推荐指数
1
解决办法
490
查看次数

如何在PHP中阅读Word,Excell和PDF文档?

我需要能够在PHP中阅读许多不同文件类型的文本,包括.doc,.docx,excel和PDF文件.我在网上发现了一些需要安装多个软件包的方法,但我想知道是否有更好的方法可以做到这一点?

php pdf excel ms-word ms-office

2
推荐指数
1
解决办法
8213
查看次数