Skip to content

Tag: php

Unable to call the built in mb_internal_encoding method?

I’m trying to install indefero on a CentOS 5.3 VMware ‘box’ and I ran into a problem. Quite early in the installation I get an error that I’ve been able to narrow down to this: I get the same error when calling this script via http through Apache. Now according to the PHP manual the mb_internal_encoding function should be a

PHP-based CSV editor? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 years ago. Improve this question Does anyone know of an online CSV editor written in PHP

removing strange characters from php string

this is what i have right now Drawing an RSS feed into the php, the raw xml from the rss feed reads: The php that i have so far is this. The above returns; If i remove the utf_decode, i get this When i try a str_replace; It doesnt work, i get; Any thoughts? Answer Try this: If this is

How to detect duplicate values in PHP array?

I am working with a one dimensional array in PHP. I would like to detect the presence of duplicate values, then count the number of duplicate values and out put the results. For example, given the following array: I would like to print: Any advice on how to approach this problem? Thanks. Mike Answer You can use array_count_values function will

PHP – Extracting a property from an array of objects

I’ve got an array of cats objects: and I want to extract an array of cats’ IDs in 1 line (not a function nor a loop). I was thinking about using array_walk with create_function but I don’t know how to do it. Any idea? Answer If you have PHP 5.5 or later, the best way is to use the built

PHP recursive search and replace array elements

I want to recursively search and replace elements in an array. The array is tree based so looks like etc. I want to be able to replace certain items with other items, so for example, I want to replace all entries in the array (at whatever depth level) of type A with an array of type B. But here’s the

How to call a JavaScript function from PHP?

How to call a JavaScript function from PHP? The following code is from xyz.html (on a button click) it calls a wait() in an external xyz.js. This wait() calls wait.php. and wait.php where loadxml() calls code from another PHP file the same way. The loadxml() is working fine otherwise, but it is not being called the way I want it.

Read pdf files with php

I have a large PDF file that is a floor map for a building. It has layers for all the office furniture including text boxes of seat location. My goal is to read this file with PHP, search the document for text layers, get their contents and coordinates in the file. This way I can map out seat locations ->