php -s

Fill php form --> upload file ---> send mail with attachment 2015-06-22

I know this question was asked several times, but I found no working answer. As the title says, I have a php form with input file type, on submit, all data will be emailed including the file as attachment, why cant i find any working script. Please h

php greater than certain time 2015-06-22

I am trying to make a simple function to output 2 different lines of text depending on the time of the day. I want it to say after 4pm - Next day delivery will be processed the following day. I have wrote this so far: <?php $currentTime = time() + 36

When is eval evil in php 2015-06-22

In all the years I have been developing in php, I've always heard that using eval() is evil. Considering the following code, wouldn't it make sense to use the second (and more elegant) option? If not, why? // $type is the result of an SQL statement /

How to get video duration, dimension and size in PHP 2015-06-22

I want to know how to get the duration, dimension and size of uploaded video file in PHP. The file can be in any video format. getID3 supports video formats. See: http://getid3.sourceforge.net/ Edit: So, in code format, that'd be like: $getID3 = new

symfony2How to make composer recognize intl php extension 2015-06-22

I'm trying to install some symfony bundles to create an admin tool found in this tutorial: http://www.ens.ro/2012/07/13/symfony2-jobeet-day-12-the-admin-bundle/ I'm using symfony 2.3.* and am using composer for my dependencies as described here: Cann

Is there any good universal PHP MySQL HTTP tunnel 2015-06-22

Many Windows MySQL tools like Navicat or EMS have this thing - You just put a PHP file on a shared hosting and can connect local running program to the remote MySQL server on the Web via the web service exposed by that php file. Are there any good po

Conditional Statements in PHP code Between HTML Code 2015-06-22

I'm having a bit of an issue by using Conditional Statements in PHP separated by HTML code. This is the type of code I'm trying to write. This is a profile page and it should only be seen by the user whose profile it is (i'm using session variables f

parsingHow do you parse and process HTML/XML in PHP 2015-06-22

How can one parse HTML/XML and extract information from it? This is a General Reference question for the php tag Native XML Extensions I prefer using one of the native XML extensions since they come bundled with PHP, are usually faster than all the 3

How to remove tags from attribute of HTML tag in php 2015-06-22

I have a large amount of post generated with old CMS. It is in HTML markup...almost...the worse of I ever seen before. It contains such constructs: ....<IMG alt="Хит сезона - <b>Лучшие фразы...</b>" src="http://www.example.co

using php regex to remove attributes from html tag elements 2015-06-22

Would like to remove any attribute within html tags and I think this can be achieved using regex but I'm not good at using regex. Tried working with str_replace but it's just not the right way to go. And I've searched for questions similar to this bu

Environment variables and PHP 2015-06-22

I have an ubuntu server with a handful of custom environment set in /etc/environment as per the ubuntu community recommendation When I use php from the command line I can use php's getenv() function to access this variables. Also, if I run phpinfo()

javascriptCORS with php headers 2015-06-22

I have a simple PHP script that I am attempting a cross-domain CORS request: <?php header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: *"); ... Yet I still get the error: Request header field X-Requested-

Inserting css source code inside the php file itself 2015-06-22

This question already has an answer here: Cannot modify header information - headers already sent by… Wordpress Issue [duplicate] 2 answers How to fix “Headers already sent” error in PHP 12 answers I am trying to insert a CSS code inside the php file

Why &quot;switch(true){}&quot; in php with a strange logic 2015-06-22

switch(false) { case 'blogHitd': echo('ddd'); break; case false: echo('bbbb'); break; default: echo 'alert("error action");'; } -------output------ bbbb switch(true) { case 'blogHitd': echo('ddd'); break; case true: echo('bbbb'); break; default:

debuggingHow to get useful error messages in PHP 2015-06-22

I find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a fai

apple push notificationsConnect to APNS by using PHP 2015-06-22

I am facing problem in connecting to APNS by using PHP. According to my learning so far :- Cerificate, private key and passphrase are correct because I have tested it using third party notification providers, also it works on my server for some time
You Might Also Like