Code: Select all
object(SimpleXMLElement)[36]
public 'COURSE_OFFERING_ID' => string '83742869' (length=8)
public 'OFFERING_NAME' => string 'Violencia causas y efectos' (length=26)
I foreach through the object, looking at each value and checking to see if its numeric. If it is, I do $value = (int) $value. Should work, but it doesn't. Looking through my debugger, it looks like $value is actually a SimpleXMLElement type and I'm actually at a bit of a loss here on how to convert this thing to an integer. I can echo $value just fine but it resists being converted no matter what I do. Any thoughts?
Code: Select all
foreach($object as $row => $value)
{
$value = (int) $value;
}