首页 \ 问答 \ $ _GET显示空值($_GET shows empty value)

$ _GET显示空值($_GET shows empty value)

我有一个test.php ,我有下面的代码

<?php

    if(isset($_GET['p']) or $_GET['p'] != null) {
        echo $_GET['p'];
    } else {
        echo "Not found";
    }

?>

我列出了下面的URL,然后需要输出显示

Test 1 : http://localhost/example/test.php
output : Notice: Undefined index: p in R:\xampp\htdocs\example\test.php on line 3
        Not found


Test 2 : http://localhost/example/test.php?p
output : blank page



Test 3 : http://localhost/example/test.php?p=
output : blank page


Test 4 : http://localhost/example/test.php?p=1
output : 1

我接受Test 1Test 2true但是当Test 2Test 3失败了解决方案。


I have a test.php and i have the below code

<?php

    if(isset($_GET['p']) or $_GET['p'] != null) {
        echo $_GET['p'];
    } else {
        echo "Not found";
    }

?>

I have listed out below urls then required output are show

Test 1 : http://localhost/example/test.php
output : Notice: Undefined index: p in R:\xampp\htdocs\example\test.php on line 3
        Not found


Test 2 : http://localhost/example/test.php?p
output : blank page



Test 3 : http://localhost/example/test.php?p=
output : blank page


Test 4 : http://localhost/example/test.php?p=1
output : 1

I accept that Test 1 and Test 2 are true But when Test 2 and Test 3 fails out the solution.


原文:https://stackoverflow.com/questions/10207796
更新时间:2023-10-29 07:10

最满意答案

您首先需要#import CAAUParameter和AUParamInfo( 可以在/ Developer / Extras / CoreAudio / PublicUtility中找到 )。

编辑 :现在可以在“Audio Tools For Xcode”包中找到这些文件。 您可以通过访问Xcode> Open Developer Tool>更多开发人员工具来获取它...

假设您有一个名为theUnit以下代码将设置您迭代theUnit的参数:

bool includeExpert   = false;
bool includeReadOnly = false;

AUParamInfo info (theUnit, includeExpert, includeReadOnly); 

for(int i = 0; i < info.NumParams(); i++)
{
    if(NULL != info.GetParamInfo(i))
    {
        // Do things with info here
    }
}

例如, info.GetParamInfo(i))->ParamInfo()将为您提供一个AudioUnitParameterInfo结构,其定义如下:

typedef struct AudioUnitParameterInfo
{
    char                        name[52];
    CFStringRef                 unitName;
    UInt32                      clumpID;
    CFStringRef                 cfNameString;
    AudioUnitParameterUnit      unit;                       
    AudioUnitParameterValue     minValue;           
    AudioUnitParameterValue     maxValue;           
    AudioUnitParameterValue     defaultValue;       
    UInt32                      flags;              
} AudioUnitParameterInfo;

请注意,您首先需要打开AudioUnit(例如,通过在包含该单元的Graph上调用AUGraphOpen())。


You'll first need to #import CAAUParameter and AUParamInfo ( which can be found in /Developer/Extras/CoreAudio/PublicUtility ).

EDIT: These files are now found in the "Audio Tools For Xcode" package. You can get it by going to Xcode > Open Developer Tool > More Developer Tools...

Assuming you have an AudioUnit called theUnit The following code will set you up to iterate through theUnit's parameters:

bool includeExpert   = false;
bool includeReadOnly = false;

AUParamInfo info (theUnit, includeExpert, includeReadOnly); 

for(int i = 0; i < info.NumParams(); i++)
{
    if(NULL != info.GetParamInfo(i))
    {
        // Do things with info here
    }
}

For example, info.GetParamInfo(i))->ParamInfo() will give you an AudioUnitParameterInfo struct which is defined as follows:

typedef struct AudioUnitParameterInfo
{
    char                        name[52];
    CFStringRef                 unitName;
    UInt32                      clumpID;
    CFStringRef                 cfNameString;
    AudioUnitParameterUnit      unit;                       
    AudioUnitParameterValue     minValue;           
    AudioUnitParameterValue     maxValue;           
    AudioUnitParameterValue     defaultValue;       
    UInt32                      flags;              
} AudioUnitParameterInfo;

Note that you'll need to open the AudioUnit first (eg. by calling AUGraphOpen() on the Graph which contains the unit).

相关问答

更多
  • 我终于弄明白了。 参数值栏是拥有音频单元视图的窗口的子窗口。 为了解决这个问题,我在NSApplication的子类中捕获了窗口的鼠标移动事件,然后关闭子窗口(aka值栏),以便它们不停留在屏幕上。 这并没有阻止退出不良访问。 我现在认为这是一个单独的问题,只是似乎与这些徘徊的儿童窗口有关。 I finally figured it out. The parameter value bars are child windows of the window that owns the audio unit v ...
  • 这里有一些非常好的资源( http://michael.tyson.id.au/2008/11/04/using-remoteio-audio-unit/ )用于使用RemoteIO音频单元。 根据我在iPhone上使用音频单元的经验,我发现我可以在回调函数中手动实现转换。 这样做,你可能会发现解决你的问题。 There are some very good resources here (http://michael.tyson.id.au/2008/11/04/using-remoteio-audio- ...
  • 您首先需要#import CAAUParameter和AUParamInfo( 可以在/ Developer / Extras / CoreAudio / PublicUtility中找到 )。 编辑 :现在可以在“Audio Tools For Xcode”包中找到这些文件。 您可以通过访问Xcode> Open Developer Tool>更多开发人员工具来获取它... 假设您有一个名为theUnit以下代码将设置您迭代theUnit的参数: bool includeExpert = false; ...
  • 我最终使用Core Audio与The Amazing Audio Engine + Audio Units一起实现压缩限制器: http : //theamazingaudioengine.com/ 这个解决方案虽然不易实现,但似乎完美无缺。 I ended up using Core Audio to implement the compressor limiter together with The Amazing Audio Engine + Audio Units: http://theamazi ...
  • 我能够通过从文件播放器的输出范围获取流格式并将其分配给varispeed单元的输出范围来解决我的问题。 //Setup a container ASBD, and zero out it's defaults AudioStreamBasicDescription asbd; memset(&asbd, 0, sizeof(AudioStreamBasicDescription)); //Get the size of the ASBD for the get property function UInt ...
  • 解决方案是在每个枚举之前添加注释。 这些注释会自动转换为枚举描述列。 ...
  • 当你改变延迟时,总会有某种失真。 这只是挑选你想要的东西。 正如您所发现的,如果您只是进入一个随机点,从一个样本值到下一个样本值的急剧跳跃通常会导致听得见的声音。 一种选择是简单地将音频静音一小段时间并再次启动。 如果这仍然太突然,您可以在几毫秒内将值缩小到零,并在几毫秒内将它们重新缩放到新的缓冲区位置。 (有效地快速降低音量,然后在你处于新位置时备份。) Propellerhead的原因实际上是模拟加速和减慢录音速度,好像它是一个磁带延迟,你正在移动头部。 这非常复杂......您有效地重新采样缓冲区音频 ...
  • 不会为独立方法生成RTTI。 希望这将在以后的版本中修复,(他们可能需要TRttiUnit类型来执行此操作),但是现在它不可用。 No. RTTI is not generated for standalone methods. Hopefully this will be fixed in a later version, (they'd probably need a TRttiUnit type to do that,) but for now it's not available.
  • Resharper中NUnit测试的显示不由NUnit处理,而是由Resharper团队编写的测试适配器处理。 NUnit使描述可用,所以如果Resharper测试运行器被修改,Resharper可以显示信息。 The display of NUnit tests within Resharper is not handled by NUnit, but by the test adapter that the Resharper team wrote. NUnit makes the descriptio ...
  • RemoteIO是因为它是最低级别的界面。 我的缓冲区大小为512帧,在44.1kHz时大约为11ms。 RemoteIO is because it's the lowest level interface. My buffer size is 512 frames, which at 44.1kHz is about 11ms.

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。