Skip to content
Advertisement

Tag: php

Creating two pdf pages with Imagick

Currently i can create PDF files from images in Imagick with this function And it’s possible to fetch multiple pages with imagick like this But is it possible to save two image objects to two pages? (example of what i am thinking, its not possible like this) Answer I know this is long past due, but this result came up

Calling a function from a string in C#

I know in php you are able to make a call like: Is this possible in .Net? Answer Yes. You can use reflection. Something like this: With the above code, the method which is invoked must have access modifier public. If calling a non-public method, one needs to use the BindingFlags parameter, e.g. BindingFlags.NonPublic | BindingFlags.Instance:

How can I unserialize session data to an arbitrary variable in PHP?

I want to unserialize a session_encode()’d string of session data to my own array (i.e. not to $_SESSION.) There doesn’t appear to be an in-built function that handles this. There’s session_decode() but it writes directly to the $_SESSION super-global. There’s unserialize() but it returns false on session_encode()’d strings as they’re a slightly different format. What’s the best way to do

Detect file encoding in PHP

I have a script which combines a number of files into one, and it breaks when one of the files has UTF8 encoding. I figure that I should be using the utf8_decode() function when reading the files, but I don’t know how to tell which need decoding. My code is basically: Currently, at the start of a UTF8 file, it

Are php strings immutable?

Or: Should I optimize my string-operations in PHP? I tried to ask PHP’s manual about it, but I didn’t get any hints to anything. Answer PHP already optimises it – variables are assigned using copy-on-write, and objects are passed by reference. In PHP 4 it doesn’t, but nobody should be using PHP 4 for new code anyway.

Application access server load

I have developed an application in PHP + JavaScript. I’m using MySQL as database support. Every account for this app will come with a subdomain… so the client Stardust would have stardust.mysite.com. I want to put the application files in a folder outside public_html and link every account from every subdomain created to this files folder through a config file

Advertisement